This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes HELP !!! - How can I call a JSP from a servlet??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HELP !!! - How can I call a JSP from a servlet???" Watch "HELP !!! - How can I call a JSP from a servlet???" New topic
Author

HELP !!! - How can I call a JSP from a servlet???

Catriona McCann
Greenhorn

Joined: Aug 31, 2000
Posts: 24
Hi,
I have a JSP which is basically a welcome screen. This JSP calls a servlet to extract some information from a DB. I would then like to call another JSP from the servlet and write to the fields in the JSP. How can I do this.
Thanks in advance !!!
Catriona.
parul jain1
Greenhorn

Joined: Apr 25, 2001
Posts: 5

forwardFileName = "/jsp/"+"homepage"+".jsp";
getServletConfig().getServletContext().getRequestDispatcher(forwardFileName).forward(req, res);
return;
bob walker
Greenhorn

Joined: Feb 20, 2001
Posts: 14
You can also do a servlet re-direct to your jsp.
Use the HttpServiceResponse.sendRedirect() method.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HELP !!! - How can I call a JSP from a servlet???
 
Similar Threads
How can i call jsp from javascript
uploading a file using jsp
To call a servlet from a JSP
java jsp
How to call a jsp from a servlet