File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL - config paramaters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL - config paramaters" Watch "EL - config paramaters" New topic
Author

EL - config paramaters

Ramya Iyer
Ranch Hand

Joined: Jul 29, 2003
Posts: 66
Hi,

Could someone help me in finding out the EL way of getting the config paramater set for a jsp? I can use initParam to get only context-param data. How do i get data the data defined in init-param using EL?

Regards,
Ramya.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Via the pageContext map :
${pageContext.servletConfig.initParameter['emailAddress']}

But it doesn't work
[ January 15, 2006: Message edited by: Satou kurinosuke ]

[My Blog]
All roads lead to JavaRanch
Gyan Shankar
Ranch Hand

Joined: Dec 12, 2005
Posts: 65
I read that pageContext is a bean and not a Map
Please advise.


SCJP(1.4), SCWCD(1.4), SCBCD(1.3), SCDJWS
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

not a map, sorry
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Check SCWCD FAQ


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Gyan Shankar
Ranch Hand

Joined: Dec 12, 2005
Posts: 65
Do you mean to say ${pageContext.servletConfig.initParameter['emailAddress']} wont work?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

yes, sorry. I've been mistaken.
Ramya Iyer
Ranch Hand

Joined: Jul 29, 2003
Posts: 66
Hi All,

when I tried with the above EL I get the error

javax.servlet.jsp.el.ELException: Unable to find a value for "initParameter" in object of class "org.apache.catalina.core.StandardWrapperFacade" using operator "."
at org.apache.commons.el.Logger.logError(Logger.java:481)
at org.apache.commons.el.Logger.logError(Logger.java:498)
at org.apache.commons.el.Logger.logError(Logger.java:611)
at org.apache.commons.el.ArraySuffix.evaluate(ArraySuffix.java:340)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)



 
GeeCON Prague 2014
 
subject: EL - config paramaters