i want to create url pattern that lead to filter in jsf2.
I tried this code
<filter-mapping>
<filter-name>filter</filter-name>
<url-pattern>www.mysite.com</url-pattern>
</filter-mapping>
but i don’t get to my filter.
can you help?
thanks
You are expecting to map the URL path, i.e. the part of URL that follows host and your web application name.
This is how full URL looks like:
http://www.mysite.com:8080/myapp/path1/path2/path3
where:
8080 is a port – optional – default 80
myapp – the context path of your web application. It is empty if your application is default web application on your app server.
path1/path2/path2the path. This is what you are mapping using<filter-mapping>tag.So, if for example you want to pass through your filter all requests to JSP pages say:
<url-pattern>*.jsp</url-pattern>If your UI is under directory
uiand you want to filter such requests say:<url-pattern>/ui/*</url-pattern>etc.