• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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");
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic