• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet initialization in JSP

 
Sreedhar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to implement the servlet initialization in JSP, example given in HFSJ book, page no. 308.

--------------------------------------------------
in DD:

<servlet>
<servlet-name>Ex1</servlet-name>
<jsp-file>/Ex1.jsp</jsp-file>
<init-param>
<param-name>email</param-name>
<param-value>sreedharp@ins.com</param-value>
</init-param>
</servlet>


in JSP :
<%
String email = config.getInitParameter("email");


%>
<%="email ---> " + email %>

-------------------------------------------

But this not seem to work. The output is null.
Any reasons for this.
 
Priya Jothi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did u also configure servlet mappings appropriately?.
 
Sreedhar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it. I did not do the mapping of the servlet.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic