File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java 8 in Action this week in the Java 8 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
Invalid user error message
Internal Servlet Error:
class cast exception in use bean
Login thing