• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp initialization parameter always gives null

 
amit veerani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jsp
-------

<html>
<head><h1 align="center">JSP Test</h1></head>
<body>
<%!int count=0;
public int getCount()
{
return ++count;
}

%>

The number of page hit is : <%= getCount()%>
</br>
the context parameter is : <%= application.getInitParameter("myemail")%>
</br>
the config parameter is : <%= config.getInitParameter("myemail")%>

</body>
</html>
















a part of DD
--------------------


<servlet>
<servlet-name>testjsp</servlet-name>
<jsp-file>/BasicCount.jsp</jsp-file>
<init-param>
<param-name>myemail</param-name>
<param-value>amitveerani@config.com</param-value>
</init-param>
<load-on-startup>
1
</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>testjsp</servlet-name>
<url-pattern>/myjsp</url-pattern>
</servlet-mapping>
<context-param>
<param-name>myemail</param-name>
<param-value>amitveerani@context.com</param-value>
</context-param>

 
amit veerani
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the config parameter is : <%= config.getInitParameter("myemail")%>


this line always gives null
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!