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.