• Post Reply Bookmark Topic Watch Topic
  • New Topic

Access static variables using JSTL  RSS feed

 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to access static variables using JSTL. I am using the following:

WebConstants.java
-----------------

public static final String name="a";

I tried to access it using JSTL ${WebConstants.name}

but i am not retrieving the information.

Any help is appreciated.

Thanks
Sudha
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
144
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That will not work. The EL (it's the EL you are asking about, not the JSTL) will only access properties of the beans.

One the other hand, what you are asking for is pretty useful, so I write this article on how to enable that a while back.
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear,
Thanks for the information.
Sudha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!