Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL - config paramaters

 
Ramya Iyer
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Via the pageContext map :
${pageContext.servletConfig.initParameter['emailAddress']}

But it doesn't work
[ January 15, 2006: Message edited by: Satou kurinosuke ]
 
Gyan Shankar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read that pageContext is a bean and not a Map
Please advise.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not a map, sorry
 
Vishnu Prakash
Ranch Hand
Posts: 1026
 
Gyan Shankar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean to say ${pageContext.servletConfig.initParameter['emailAddress']} wont work?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, sorry. I've been mistaken.
 
Ramya Iyer
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic