This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp init parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "jsp init parameters" Watch "jsp init parameters" New topic
Author

jsp init parameters

Sharma Anjali
Ranch Hand

Joined: Feb 22, 2005
Posts: 63
i am trying to retreive init paramters in my jsp.
Here's the DD

<servlet>
<servlet-name>T</servlet-name>
<jsp-file>/A.jsp</jsp-file>
<init-param>
<param-name>email</param-name>
<param-value>abc@zyz.com</param-value>
</init-param>
</servlet>


and this is in the jsp page

<%= config.getInitParameter("email") %>

But this returns null.
Plz tell me where am I doing it wrong?
srinath anand
Ranch Hand

Joined: Nov 20, 2001
Posts: 30
Hi Anjali,
You need this in your web.xml also:

<servlet-mapping>
<servlet-name>T</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>


SCJP2,SCWCD 1.4
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: jsp init parameters
 
Similar Threads
servlet initialization in JSP
Why this code to get Init Param in JSP not work?
how to get jsp init params
init parameter from jsp
Initializing JSP.