• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirecting to 3 different pages

 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
My aim is to write a servlet which pops up a jsp page( first.jsp) in the beginning. Since my client is using Apache JServ, we are using JSDK2.0 and since using sendRedirect method. In the servlet after displaying the first.jsp I am continuing with my other procedure calls, that is doing a JDBC stored procedure call. Then depending upon the result of the Stored Procedure, if it is yes, I have to redirect to another page(Sucess.jsp ) and if failure to a second one(fail.jsp)
I tried using sendredirect again, but the effort is in vain.
Can anyone help me please.
This is an urgent requirement
Thanks,
Maya
 
vivek sivakumar
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi maya,
kindly visit my post 2 Clarifications and see if u could suggest me some useful tips on that!!!
thanks in advance.
 
d frazier
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might try this not so pretty, but effective method...
load (first page - Welcome.html)
then initiate your calls to database (from button click, javascript timer, etc.), forward to a "hidden jsp" that displays nothing but database stuff and sets vars
then pass to handler, evaluate vars and re-direct to the possible output.
Remember that once the headers are written, you'll be limited with the methods that you can use for a re-direct.
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frazier,
Thanks for the rsponse.
Do you have any sample code for sending to a hidden jsp ?
If so can you send it to me at google_n@hotmail.com ?
Thanks,
Maya
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frazier,
Thanks for the suggestion to redirect to a hidden jsp.
I tried redirecting to a secong jsp and did the coding so that the second jsp calls the database validation servlet. After the validation this servlet easily calls the success and fail pages.
Thanks a lot
Maya
 
verduka fox
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello --
I know this post is somewhat old, but I think it applies to my situation. Please post the sample code for forwarding to a hidden jsp.
Also, what does:
"Remember that once the headers are written, you'll be limited with the methods that you can use for a re-direct."
mean? Please explain.
Thanks in advance!
v
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic