Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

want to use sendRedirect() but facing problem

 
Mahajan Bhupendra
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
if i want to print an error to user and than
i want to use sendRedirect() then what shoul di suppose to do?
e.g. if i m asking for userid and password if they are not
correct i want to reappear the same page but with error..
printing using printwriter also dosen't helped..
Bhupendra
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mahajan,
Please refer to "gotoPage(..)" method explained in this discussion. If you want to display the old contents which user type previously, then you have to put the object in session/request and grab the dynamic contents from those beans in your jsp file.
regds
maha anna
http://www.javaranch.com/ubb/Forum7/HTML/000666.html

 
vaibhav punekar
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you are using srvlet,then put the error msg in session
String eermsg="Invalid Login";
Append this "errmsg" to your URL while redirecting. http://localhost:7001/servlet/SERVLETNAME?errmsg="+errmsg+"
 
vaibhav punekar
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you are using srvlet,then put the error msg in session
String eermsg="Invalid Login";
Append this "errmsg" to your URL while redirecting. http://localhost:7001/servlet/SERVLETNAME?errmsg="+errmsg+"
 
Mahajan Bhupendra
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx vaibhav..
good idea..
Bhupendra
 
Gaurav Kalra
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess u could also use javascript for that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic