• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Call JSP from Servlet(Urgent)

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a servlet(trimrec.java) file which has a javascript button.
When i click the button, i want some attributes that
are set to be passed to a JSP file(/search.jsp).

ServletContext sc = this.getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher("/search.jsp");
if (rd !=null) {
// Pass control to the JSP.
try {
rd.forward(request, response);
} catch (Exception e) {
sc.log("Problem invoking JSP.", e);
}
}

This is inside a get method of trimrec.java servlet.
What happens is that my tomcat gets automatically shutdown
when it processes this code...
Please do reply me what to do..This happens because i have codings
followed after the above in the servlet file...
Regards
Madhan
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try to do RequestDispatcher rd = request.getRequestDispatcher("/search.jsp");
 
reply
    Bookmark Topic Watch Topic
  • New Topic