• Post Reply Bookmark Topic Watch Topic
  • New Topic

accessing constants in JSP (without scriptlet)

 
Dan Murphy
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a class that defines the names of various session attributes, e.g.


I would like to use these constants within a JSP to test for the presence of these attributes, something like:



But I can't seem to get the sytax correct. Also, to avoid repeating the rather lengthy tests above in multiple places, I'd like to assign the result to a local (page-scoped) variable, and refer to that instead. I believe I can do this with <c:set>, but again I'm struggling to find the correct syntax.

Cheers,
Dan
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see this article.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!