wood burning stoves 2.0*
The moose likes JSP and the fly likes config implicit object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "config implicit object" Watch "config implicit object" New topic
Author

config implicit object

subathra sangameswaran
Greenhorn

Joined: Nov 19, 2005
Posts: 27
Hallo Everyone,
I am trying to learn jsp.
why does not this scriptlet in my form.jsp work?
<%= config.getInitParameter("email") %>
My web.xml has the following

<servlet>
<servlet-name>MyJSPServlet</servlet-name>
<jsp-file>/form.jsp</jsp-file>
<init-param>
<param-name>email</param-name>
<param-value>subansuba@yahoo.co.in</param-value>
</init-param>
</servlet>

I simply get
My Contact: null
when i get to this page

Thanks and regards


suba
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Are you hitting the JSP directly?
If so, init params won't show up.
You'll need to create a servlet mapping and point your browser to the url-pattern from your mapping.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
subathra sangameswaran
Greenhorn

Joined: Nov 19, 2005
Posts: 27
Thanks. I works. I am just a beginner. Sorry for making too silly questions...
This topic may be closed
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

It wasn't a silly question.
There is no need to close the thread.
It will sink into the abyss as newer ones show up and push it down.
Glad it's working and Welcome to Javaranch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: config implicit object
 
Similar Threads
init parameter from jsp
jsp init parameters
implicit object doubt
config with JSP
Servlet Initialization using JSP