Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
JSP
Enums in JSPs
Ryan Kade
Ranch Hand
Posts: 69
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Did some searching both in the forums and Google and didn't find a good answer to this question: how do I access an enum using EL in
JSP
? Is it even possible?
If I have an enum:
enum Season { WINTER, SPRING, SUMMER, FALL }
I'd like to be able to access it in the JSP:
<c:if test="${requestScope.currentSeason == Season.SPRING}"/> ... </c:if>
Any suggestions?
Bear Bibeault
Sheriff
Posts: 67754
173
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Not possible. The EL is geared towards beans and their properties.
I came up with a solution for class constants as outlined in
this article
, perhaps a similar tactic for enums would work?
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JSTL if statement does not work
Problem with nested c:forEach
JSP taking long time to load
How to pass attribute to a custom tag only if it evaluates to a non null value
JSP and String manipulation
More...