wood burning stoves 2.0*
The moose likes JSP and the fly likes Is this illegal in JSP 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 » JSP
Bookmark "Is this illegal in JSP" Watch "Is this illegal in JSP" New topic
Author

Is this illegal in JSP

Sree Mami
Ranch Hand

Joined: Jul 13, 2006
Posts: 75
Hi all,

I have problem forwarding request to other JSP pages from my current jsp page. My code includes:

Form1:


Form2:


Form3:



Please clarify, as I am getting NullPointerException in the line forwarding page to Form1.jsp.
nizams uddin
Greenhorn

Joined: Jul 31, 2006
Posts: 15
check whether the hidden variable is between form tags
Sree Mami
Ranch Hand

Joined: Jul 13, 2006
Posts: 75
Ya that may be true, I just tried and got success.

Thanks for the valuable information..
Shilpa Tendulkar
Ranch Hand

Joined: Jul 29, 2001
Posts: 75
best way to avoid any future NPE, check
if(fname != null && fname.equals("FORM1")){ .... }


SCJP5
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Another way to do it is to write the logic like this:



It will never result in a null pointer exception, and has the same effect at the end of the day.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this illegal in JSP
 
Similar Threads
Getting html form name
Find requested source form
How to rendar data from new window to old window through window.focus() ? Or any other way.
Multiple form with one action
a doubt in servlet invocation..