Hi Guys,
I am having trouble retrieving an init-param in a filter for a web
application. My deployment descriptor that is built by netbeans 5.5
20060907 seems to look correct. I didn't get an error during
deployment, the relevant section is below:
<filter>
<filter-name>CaptchaValidateFilter</filter-name>
<filter-class>com.sun.javaee.blueprints.petstore.controller.CaptchaValidateFilter</filter-class>
<init-param>
<param-name>entryPages</param-name>
<param-value>index.html|index.jsp|fileupload.jsp|search.jsp|catalog.jsp|mapAll.jsp|.jpg|.gif</param-value>
</init-param>
</filter>
<filter>
The code in the filter is as follows...
public void init(FilterConfig filterConfig) {
this.filterConfig = filterConfig;
// TEST Code
String entryPagesParam=filterConfig.getInitParameter("entryPages");
System.out.println("\n*** entry String = " + entryPagesParam);
for (Enumeration e = filterConfig.getInitParameterNames();
e.hasMoreElements() ;) {
System.out.println("\n*** ParamName=" + e.nextElement());
}
"*** entry String = nulll" gets printed to the server.log and the
parameters aren't printed from the getInitParameterNames enumeration.
I did try to access the ServerParams by using the code below and all the
servlet parameters printed to the log as expected:
for (Enumeration e =
filterConfig.getServletContext().getInitParameterNames();
e.hasMoreElements() ;) {
System.out.println("\n*** ParamName=" + e.nextElement());
}
I searched the bug database and couldn't find and issues.
Any help would be appreciated...
Please let me know...
Thanks - Mark