Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ryan Day
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • 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>
 
Hendy Setyo Mulyo
Ranch Hand
Posts: 219
Firefox Browser Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic