jQuery in Action, 3rd edition
The moose likes JSP and the fly likes Enums in JSPs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Enums in JSPs" Watch "Enums in JSPs" New topic
Author

Enums in JSPs

Ryan Kade
Ranch Hand

Joined: Aug 16, 2005
Posts: 69
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:



I'd like to be able to access it in the JSP:



Any suggestions?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63349
    
  70

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enums in JSPs
 
It's not a secret anymore!