Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

request.getAttribute  RSS feed

 
Atef Sarraj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi alll,
I want test if a variable equal to null ,else i will display two button , this variable i will get it from FileAction.java , so i make this in my page jsp (File.jsp)



the error is:

thanks for help
 
E Armitage
Rancher
Posts: 989
9
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the attribute is null then you can't call toString (or any method) on it.
You would use to do the null check.

Consider using EL for these checks. It results in cleaner and easier to read pages.
 
Atef Sarraj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java code in a JSP? In 2012? :shock:

You should be using the JSTL's <c:if> tag to test the condition, not old-fashioned Java code.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!