File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Is this illegal in JSP" Watch "Is this illegal in JSP" New topic

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:




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

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")){ .... }

Stefan Evans

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:
subject: Is this illegal in JSP
Similar Threads
a doubt in servlet invocation..
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
Getting html form name