• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why is there no EL implicit object for Servlet Init Params?

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone explain how you would get access to the Servlet init parameters in a JSP page using the JSP implicit variables or EL implicit variables?

I'm a little confused why EL has the initParam map to get the Context Parameters, but nothing similar for Servlet Init Parameters. It makes me think I may be missing an important concept somewhere.

After all, aren't you able to configure a JSP file with Servlet init parameters with the following DD configuration?

<servlet>
<servlet-name>JSPWithParameters</servlet-name>
<jsp-file>MyJSP.jsp</jsp-file>
<init-param>
<param-name>PageTitle</param-name>
<param-value>Welcome to this page!</param-value>
</init-param>
</servlet>
 
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ryan,

You can check the FAQ:
http://faq.javaranch.com/view?InitParamsThruExpressionLanguage

It explain how to access servlet init parameters using EL.
 
Ryan Day
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Hendy. I can't help wondering why they didn't include a map of the Servlet init params as an implicit EL object...
reply
    Bookmark Topic Watch Topic
  • New Topic