Cameron Harr's CS462 Page
Home  About  CS 462  Contact 
Lab 4 -- JSP, Java Beans & MVC 100% Pure Vim Web Site
Home > Lab 4

 
Links:

Jmeter Results:

  JSP Servlet CGI
Data (Get/Post) 101/95 47/63 46/133
Average (Get/Post) 104/99 65/46 64/59
Deviation (Get/Post) 38/5 40/4 35/22

Log:

    The first thing to do here is to get the custom tags working. To do this, we basically make a java file, put it in a package, include javax.servlet.jsp.* and javax.servlet.jsp.tagext.* and compile it. We also need to make a tag library descriptor file with the name of the package. In my case, I called the package mytags, so the descriptor file was mytags.tld and it resides inside the WEB-INF folder. There's also the web.xml file there in which it is necessary to register the tag library. With that done, you just need to include the tag library in the jsp header of the file. For example, I would include the following:
    <%@ taglib uri="/WEB-INF/jsp/mytaglib.tld" prefix="disp" %>.

    The trick for this lab to work is create a custom tag with all, or most of the java code inside that tag. For this, I have a tag called Dispatch that I simply call from a page (Dispatch.jsp) and it does nearly all the work. As I mentioned, It largely contains the code written for the servlet -- at least the algorithms. When I need to redirect to another page, I use the HttpServletResponse object to call the sendRedirect(URL) function. This then takes me either to a new-user page, a previous-user page, an authentication page, or a file deletion page. For the previous-user page, this is also the survey and it has it's own custom tags called getColor, getTaken, and getUser to set up the environment for the page. Other than that, it is mostly the same old stuff.



For more great website ideas, visit Jaden.
Copyleft © 2002 Cameron No rights reserved.
Last Updated 03/01/02