aspose file tools*
The moose likes Servlets and the fly likes Display a webpage after running the servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Display a webpage after running the servlet" Watch "Display a webpage after running the servlet" New topic
Author

Display a webpage after running the servlet

Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Hi,
now i am writing a servlet to write into a jsp file. which mean i execute the servlet program, the program will write the data(html and others) and save in a jsp file. how do i display the jsp file after i execute the servlet without giving a link to link to that jsp page??
thanx in advance...
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Ann Toh:
the program will write the data(html and others) and save in a jsp file. how do i display the jsp file after i execute the servlet without giving a link to link to that jsp page??
thanx in advance...

Its not good idea to the dynamic content into a jsp file and display it. You can directly display the output the same servlet that you used to capture/process data!..
If you still want to use jsp option, then you can use the redirect() function to direct to the jsp from the servlet.


Spritle Software Blogs
Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Hi Balaji Loganathan,
thank for ur help. actually, i have written the program to display the jsp page but it does not display, so i have to write and save it as a jsp file then i need to point to the jsp file and display it.
can u tell me how to write a redirect() function in the servlet to point to that jsp file??
thanx in advance...
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 639
response.sendRedirect("urjspname.jsp");
Praful


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Ann Toh
Ranch Hand

Joined: Jul 18, 2003
Posts: 45
Hi Praful Thakare,
thanx for ur help. i can get to link to my jsp page.
 
 
subject: Display a webpage after running the servlet