• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing various types of Parameters from EL

 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EL, is there no way to access the servlet initialization parameters for the jsp?

initParam is a map of application context parameters & param is a map of request parameters but I don't see any implicit objects for the servlet init parameters defined in the DD for that jsp.

So, how could we access those in EL?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64180
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's rare to need such init parameters in a JSP that's properly focused on view generation, so such a capability was not added to the EL. If you really need them (and you're being careful not to be using the JSP for purposes for which it should not be used), you can grab the init params in the controller and pass them to the JSP as scoped variables.

Or, write a nice little custom tag that does it for you.
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer, Bear.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic