Declaring 2 filters........

G

gbattine

Hi guys,
i need your help for a simple question.
I'm developing a jsf application and i have to use 2 different filters,
one for fileUpload of Myfaces and another one for giving or not giving
authorizations to protected pages.
How can i declare the 2 filters in web.xml?
My code is right?I say it because the second filter i've added(the
authorizator) don't works...
I need your help,this is my web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<!-- This is the filter for upload -->
<filter>
<filter-name>ExtensionsFilter</filter-name>

<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>20000m</param-value>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>10000k</param-value>
</init-param>
</filter>

<!-- This is the filter protecting pages from unathorized access -->
<filter>
<filter-name>AuthorizationFilter</filter-name>
<filter-class>Javasource.giu.AuthorizationFilter</filter-class>
</filter>
<!-- This is the filter mapping for authorizator -->
<filter-mapping>
<filter-name>AuthorizationFilter</filter-name>
<url-pattern>/faces/protected/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AuthorizationFilter</filter-name>
<url-pattern>/faces/general/*</url-pattern>
</filter-mapping>

<!-- This is the filter mapping for upload -->
<filter-mapping>
<filter-name>ExtensionsFilter</filter-name>
<servlet-name>FacesServlet</servlet-name>
</filter-mapping>
<servlet>
<servlet-name>FacesServlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>FacesServlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/nomedb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>



Can you help me?
My AuthorizationFilter is situated in Javasource/giu, is it correct the
declaration of the 2 filters?
I need to do other things in web.xml or faces-config.xml?
I'm waiting for your help,thanks...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top