hi,
is there any way to access the servletconfig from jsp, using the web.xml data. i want to allow my jsp page to read in a file path, but don't want it in the code, someone else will be changing the path and does not wish to touch the code. i've tried but no luck:
web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2.2dtd">
<web-app>
<servlet>
<servlet-class>ReadList</servlet-class>
<init-param>
<param-name>Path</param-name>
<param-value>TEst</param-value>
</init-param>
</servlet>
</web-app>
.jsp file:
String str = getInitParameter("Path");
out.print(str);
always get null returned. any ideas? the file is a jsp not a servlet, i wasn't sure how to map a jsp so i used the <servlet-class> assuming that since a jsp get complied into a servlet it would work, but doesn't.
Thanks.