• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Question......  RSS feed

 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai all!
is it possible to invoke servlet from JSP such that control shall be back to JSP just like we invoke other JSP pages with Include tag?
TIA
Rgds
Manohar
 
Peter Guillebaud
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Monahar,
I've found that if you include this line
//refresh to jsp page
response.sendRedirect( jspPage );
at the end of the servlet code, then the browser returns to the jsp page.
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai GillBaud!
That is correct but not a correct choice. If u used that code The process will be a cyclic. Secondly what i exactly i want is JSP1 calls Sevlet1 that calls JSP2 and finally control is in JSP1 next to the statement where it invokes servlet.
I got it by using include tags and Request dispatch include methods.
Rgds
Manohar
 
Peter Guillebaud
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Glad you found a better way to do this... what does it mean if the code I used is cyclic? is this bad practice?
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai!
Sorry that i told that it will be cyclic. But it's not a correct choice in my requirement as i need to displat the contents of JSP2 on JSP1.
if i used sendRedirect the control will be back to JSP1 which is not the thing that i exactly i wanted.
Rgds
Manohar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!