Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Config params for servlets: reading in JSP

 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my jsp I am trying to print servlet config parameters and context params from a forwared jsp page using :

Init params for context :

<cut value="${initParam.contextname}" />



Config params for servlets:
<%=config.getInitParameter("name1")%>
<cut value="${pageContext.config.name1}" />

The context params are being displayed correctly but the servlet config params cannot get printed and there is an ELException as:

javax.servlet.jsp.el.ELException: Unable to find a value for "config" in object of class "org.apache.jasper.runtime.PageContextImpl" using operator "."


Please suggest what is going wrong here?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this FAQ.
 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!