Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jsp get init parameter??

843841Aug 13 2003 — edited Aug 13 2003
I wrote a jsp(my.jsp):
<%= config.getInitParameter("id") %>
<%= application.getInitParameter("id") %>
<%= getServletConfig().getInitParameter("id") %>

and configure web.xml of Tomcat4.1 like this:
<servlet>
<servlet-name>getInit.jsp</servlet-name>
<jsp-file>/temp/getInit.jsp</jsp-file>
<init-param>
<param-name>id</param-name>
<param-value>0</param-value>
</init-param>
</servlet>

but when i load jsp
http://localhost/temp/my.jsp

it only shows
null null null

why??? how to configure web.xml let jsp to get init parameter??
thx all.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2003
Added on Aug 13 2003
1 comment
169 views