• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OGNL if test throws null stacktrace error

 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a login page that uses OGNL to display errors from a Action when the login fails. The page that is initially loaded and the failure page are the same:



On the initial load of the page before the action has run and given a variable back to OGNL I get a stack trace error like attached.

Is there as simple way to check for a null with OGNL so I wont get this stack trace error?

Thanks,
Earl
targetNull.jpg
[Thumbnail for targetNull.jpg]
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this..it will work.


 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raza Mohd wrote:try this..it will work.




Thanks Raza but the code above throws the following error in struts:

Struts has detected an unhandled exception:

Messages: /login/index.jsp(14,13) quote symbol expected
JSPException including path '/login/index.jsp'.
javax.servlet.jsp.JspException: IO Error executing tag: JSPException including path '/login/index.jsp'.
ServletException including path '/tiles/login_layout.jsp'.
ServletException including path '/tiles/login_layout.jsp'.

 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raza I experimented with the idea you gave me. This works without throwing a null pointer exception to the stack trace when there is no variable from the Action. Thanks for your help
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your welcome
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic