Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

config implicit object

 
subathra sangameswaran
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
subathra sangameswaran
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I works. I am just a beginner. Sorry for making too silly questions...
This topic may be closed
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic