• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL

 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL implicit "initParam" is for context params.

what is EL implicit for init params?

------------------------------------------------------------
For example,

With scripting: <%= application.getInitParameter("name")%>
with EL : ${initParam.name}
------------------------------------------------------------
With scripting: <%= config.getInitParameter("name")%>
with EL : ???
-------------------------------------------------------------

please clarify !!
 
Jack Lee
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can use this one

${pagecontext.servletConfig.initParam['name']}
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${pagecontext.servletConfig.initParam['name']}


I don't think this would work, because ServletConfig's method signature is getInitParameter(java.lang.String name), not conforming to the JavaBean spec.

To my understanding, there's no implicit objects allowing you to get Servlet's initParams via EL.
 
cheenu Dev
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${pagecontext.servletConfig.initParam['name']}

just a change to this might work i think,

${pagecontext.servletConfig.initParameter['name']}
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just a change to this might work i think,

What makes you think so ? Please tell us something that will work
 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes of course it will not work
 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Authors,
could you please confirm that there's no implicit objects allowing to get Servlet's initParams via EL???
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is such a common question that a brief search through the forum would have turned up this:

http://faq.javaranch.com/view?InitParamsThruExpressionLanguage
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Authors, could you please confirm that there's no implicit objects allowing to get Servlet's initParams via EL???

Thanks for not trusting common mortals
 
navat venu
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi satou,

its not the matter of trust

i was in need to get more information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic