Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bean forward to jsp page ?

Status
Not open for further replies.

jbruggeman

Programmer
Jun 24, 2002
6
0
0
BE
Hello,

I would like to implement the equivalent of the jsp tag :

<jsp:forward page=&quot;next.jsp&quot;>

in a servlet.

What I want to do is: a jsp or html page has a form with a get or post, which connects to a servlet, which forwards the processing results of the form towards a jsp page which formats it.

any tips / hints ?
 
Just for the sake of documentation, I post the solution I've found:

if (action.equalsIgnoreCase(&quot;login&quot;)) {
nextPage = &quot;/doorgeefeinde.jsp&quot;;
} else if (action.equalsIgnoreCase(&quot;einde&quot;)) {
nextPage = &quot;/doorgeefbegin.jsp&quot;;
} else {
nextPage = &quot;/fout.jsp&quot;;
}
ServletContext context = getServletContext();
RequestDispatcher rd = context.getRequestDispatcher(nextPage);
rd.forward(req, resp);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top