Karen,

On Fri, 29 Nov 2019 at 20:51, Karen Goh <karenwo...@yahoo.com.invalid>
wrote:

>
>
>
> Sent from Yahoo Mail for iPhone
>
>
> On Friday, November 29, 2019, 8:39 PM, Karen Goh
> <karenwo...@yahoo.com.INVALID> wrote:
>
>
>
>
>
>
> On Friday, November 29, 2019, 6:59:38 PM GMT+8, Mark Thomas <
> ma...@apache.org> wrote:
>
>
> On 29/11/2019 10:44, Karen Goh wrote:
> > Hi experts,
> >
> >
> > Basically, I have now upgraded my dynamic MVC web app to use openJDK 13
> and running it with Tomcat 9.0.27. Windows OS. Eclipse 2019-09.
> >
> > Have been trying to tackling the problem with no avail.
> >
> > Would appreciate some tips on how to make these error go away.
>
> <snip/>
>
> > Caused by: java.lang.IllegalArgumentException: Filter mapping specifies
> an unknown filter name [httpHeaderSecurity]
>
> <snip/>
> I am not sure why the error persists even if I change the filter mapping
> to :
>
> <filter-mapping><filter-name>SessionValidator<filter-name><url-pattern>/login.jsp<url-pattern><filter-mapping>
> And here is snippet my Filter :
> @WebFilter(“/SessionValidator”)public class SessionValidator implements
> Filter....
> public void doFilter(ServletRequest request, ServletResponse response,
> FilterChain chain) throws IOException, ServletException{
> ......HttpSession session = httpRequest.getSession();If(session.isNew())
> {httpResponse.sendRedirect(httpResponse.encodedRedirectURL(httpRequest.getContextPath()
> + “/login.jsp”return;}And then redirect the user to error.html if log in
> user is null.
> Please let me know what’s wrong.
> Thanks
> Where and how is this filter specified as being required?
> Where and how is this filter defined?
>
> Please see below
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns="
> http://xmlns.jcp.org/xml/ns/javaee"; xsi:schemaLocation="
> http://xmlns.jcp.org/xml/ns/javaee
> http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"; version="4.0">
>  <display-name>Archetype Created Web Application</display-name>
>  <security-constraint>
>  <web-resource-collection>
>  <web-resource-name>Restricted Area</web-resource-name>
>  <url-pattern>/search.jsp</url-pattern>
>  </web-resource-collection>
>  </security-constraint>
>  <filter>
>  <filter-name>SessionValidator</filter-name>
>  <filter-class>Controller.SessionValidator</filter-class>
>  </filter>
>  <error-page>
>  <error-code>404</error-code>
>  <location>/error.html</location>
>  </error-page>
>  <error-page>
>  <error-code>403</error-code>
>  <location>/error.html</location>
>  </error-page>
>  <error-page>
>  <error-code>500</error-code>
>  <location>/error.html</location>
>  </error-page>
>  <error-page>
>  <exception-type>java.lang.Exception</exception-type>
>  <location>/error.html</location>
>  </error-page>
> </web-app>
>
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
>
>
>
 I would advise that you remove @WebFilter and try again. Seems like it's
conflicted with processing annotation based and web.xml supplied filter
definitions.
Once you remove the annotation, give it a try and let us know.

Thanks,

Reply via email to