Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PropertyResourceBundle and EL

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can the new EL access properties from a PropertiesResourceBundle stored in the ServletContext()?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question. PropertyResourceBundle (and its ancestor ResourceBundle) do not implement the Map interface (which would have clinched it), so unless the EL code was written specifically to interact with the bundles, I'd say the bet was off.
Have you tried it yet?
bear
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Good question. PropertyResourceBundle (and its ancestor ResourceBundle) do not implement the Map interface (which would have clinched it), so unless the EL code was written specifically to interact with the bundles, I'd say the bet was off.
Have you tried it yet?
bear

Yeah, I have tried it, and since my ServletContext problem persists from my post in Servlets, I don't know if it won't work, or just isn't working.
I initially tried doing ${template.name} and I got some error about how it couldn't find it. Then I did ${template[name]} and I don't get an error, but I also don't get any output. ??
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, ResourceBundle objects won't work but Properties Objects work just fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic