This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Use of Class constants in EL expressions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Use of Class constants in EL expressions" Watch "Use of Class constants in EL expressions" New topic
Author

Use of Class constants in EL expressions

Akshay Singhvi
Ranch Hand

Joined: Nov 08, 2005
Posts: 93
Hello Ranchers,
Can we use constants declared in a class file in EL expressions for eg.
public class A {
public static final String a = "AB";
}

Now in the JSP, assume i have imported the class A then will this work
${A.a == "AB"}


Regards,<br />Akshay Singhvi<br />SCJP 1.4 (95%)<br />SCWCD 1.4 (86%)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60766
    
  65

That is precisely the subject of this article.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Use of Class constants in EL expressions
 
Similar Threads
EL-rendering of if-then-else
What is the best practice of handling attribute names?
Legal expressions for switch and case statements
Use of Class constants in EL expressions
NullPointerException...