• Post Reply Bookmark Topic Watch Topic
  • New Topic

scriptless enum element instantiation  RSS feed

 
paulo ambrocio
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there a way to instantiate an enum element without using scripts
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a JSP? no. But if you are writing scriptless JSPs, why would you need an enum instantiated? That's something that should be handled by the controller.
 
paulo ambrocio
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi first of all thanks for the reply i was pondering on a scenario where i have a map i need to display on a jsp which uses enums as keys.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah... one approach would be to use the .name() of the enum rather than the enum itself as the Map key.

Remember: set up the constructs that you will send to a JSP to suit the JSP, rather than cause contortions within the JSP to accommodate unsuitable constructs.
 
paulo ambrocio
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks i'll keep that in mind
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!