This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page redirection problem

 
Arpit Maheshwari
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




Need help with this code...
When the username is null, the page should get redirected to the register.jsp but the page is being forwarded by the <jsp:forward> to StudentRegistration.
What should I do....??
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch Arpit Maheshwari

Coming to your question ; I am surprised that you did not get an exception saying that *java.lang.IllegalStateException: Cannot forward after response has been committed*!
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
importantly avoid scriptlet in JSPs
 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The HTML form from which you send the request would always contain "username" parameter... So, no chance of "null"... Better you could make a check against empty string...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic