GeeCON Prague 2014*
The moose likes JSF and the fly likes page redirection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "page redirection problem" Watch "page redirection problem" New topic
Author

page redirection problem

Arpit Maheshwari
Greenhorn

Joined: Dec 06, 2011
Posts: 5




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

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jan 28, 2008
Posts: 5575

importantly avoid scriptlet in JSPs
Ram Narayan.M
Ranch Hand

Joined: Jul 11, 2010
Posts: 247

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...


SCJP 6 [SCJP - Old is Gold]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: page redirection problem