• 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

EL and context-param???

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when i try to access my context-param with scriplets is no problem
but with EL doesnt work

so hlet say that i have context-param ant init-param
how would i get both?
i found this definition

initParam - a java.util.Map that maps context initialization parameter names to their String parameter value (obtained by calling ServletContext.getInitParameter(String name)).


but how to do
getServletConfig().getInitParameter(String name) in EL?

can anyone help?

[ September 22, 2005: Message edited by: Ner min ]
[ September 22, 2005: Message edited by: Ner min ]
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ner,

Make sure you understand the EL implicit objects.
There is no implicit object to get the servlet init param.


pageContext is the only object that you can use to get other associated info...

Except for pageContext, other implicit objects are Maps...

See if you can find any solution in this link...
You have to go through the pageContext.....but...."servlet init param" is old school as the author mentioned...

Look at the last comment made by Kathy Sierra.

https://coderanch.com/t/168431/java-Web-Component-SCWCD/certification/EL-retrieving-init-param-servlet

Thanks.
Esam

SCJP 1.4, SCWCD 1.4, SCBCD (in progress...just starting)
 
Ner min
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tnx Esam,
that was usefull, so there is no way to get that init-param in EL, even if u use pageContext. The only way is ,as far i understud to get that init-param thruogh some scriplet/servlet and put it in some scope-attribute and then get it with EL with getAttribute.
But as Kathy suggest we schultnt use init-param at all in our apps, as this is old school.

well, thats good neww, one thing less to worry about - except it pops up in exam

hmm one thing more, is there any full EL-referenz where one could see all stuff which is inside pageContext, couse in j2ee api is nothing about EL?
[ September 22, 2005: Message edited by: Ner min ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic