Meaningless Drivel is fun!*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "page redirection problem" Watch "page redirection problem" New topic

page redirection problem

Arpit Maheshwari

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]
I agree. Here's the link:
subject: page redirection problem
Similar Threads
Internal Servlet Error:
Invalid user error message
Login thing
class cast exception in use bean