Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this illegal in JSP

 
Sree Mami
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check whether the hidden variable is between form tags
 
Sree Mami
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya that may be true, I just tried and got success.

Thanks for the valuable information..
 
Shilpa Tendulkar
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
best way to avoid any future NPE, check
if(fname != null && fname.equals("FORM1")){ .... }
 
Stefan Evans
Bartender
Posts: 1718
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic