Back Forum Reply New

Please help!! how to configure in web.xml?

Hii all,
I am able to include Spring Security to the petclinic example in which i am able to login and also use method level security.But i have been trying to use the same example as a reference to my project.So far i am able to login using the different roles and also use the lt;sec:authorizegt; tag in order to show and hide the components.. But i am still not able to do method level security in my project.Is there any extra configuration to be done in the XML files? Currently i have a web.xml,applicationContext.xml and applicationContextSecurity.xml.Can anyone help me on wat all specifically to include in these XML files so that i can do method level restriction.. PLzz help...Also my beans are all given in faces-managed-beans.xml ..is there anything to be done in that file?
This is my applicationContextSecurity.xml file

Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;beans:beans xmlns=quot;schema/securityquot;
xmlns:sec=quot;schema/securityquot;
xmlns:beans=quot;schema/beansquot;
xmlns:xsi=quot;2001/XMLSchema-instancequot;
xsi:schemaLocation=quot;schema/beans schem...-beans-2.5.xsd
schema/security schema/security/spring-security-2.0.1.xsdquot;gt;
lt;global-method-security secured-annotations=quot;enabledquot;gt;
lt;protect-pointcut expression=quot;execution(* com.myapp.uwrn.view.bean.SecuredObject.*(..))quot;
access=quot;ROLE_SUPERVISORquot;/gt;
lt;/global-method-securitygt;
lt;from auto-config=quot;truequot;gt;
lt;intercept-ucl pattern=quot;/*.jspquot; access=quot;ROLE_USERquot; /gt;
lt;intercept-ucl pattern=quot;/**quot; access=quot;IS_AUTHENTICATED_ANONYMOUSLYquot; /gt;
lt;intercept-ucl pattern=quot;/**quot; access=quot;IS_AUTHENTICATED_ANONYMOUSLYquot; /gt;
lt;/fromgt;
lt;!--
Usernames/Passwords are
rod/koala
dianne/emu
scott/wombat
peter/opal
--gt;
lt;authentication-providergt;
lt;password-encoder hash=quot;md5quot;/gt;
lt;user-servicegt;
lt;user name=quot;rodquot; password=quot;a564de63c2d0da68cf47586ee05984d7quot; authorities=quot;ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLERquot; /gt;
lt;user name=quot;diannequot; password=quot;65d15fe9156f9c4bbffd98085992a44equot; authorities=quot;ROLE_USER,ROLE_TELLERquot; /gt;
lt;user name=quot;scottquot; password=quot;2b58af6dddbd072ed27ffc86725d7d3aquot; authorities=quot;ROLE_USERquot; /gt;
lt;user name=quot;peterquot; password=quot;22b5c9accc6e1ba628cedc63a72d57f8quot; authorities=quot;ROLE_USERquot; /gt;
lt;/user-servicegt;
lt;/authentication-providergt;
lt;/beans:beansgt;
This is my web.xml

Code:
lt;?xml version=quot;1.0quot;?gt;
lt;!DOCTYPE web-app PUBLIC
quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//ENquot;
quot;dtd/web-app_2_3.dtdquot;gt;
lt;web-appgt;
lt;display-namegt;My Applicationlt;/display-namegt;
lt;descriptiongt;
Myapplication.
lt;/descriptiongt;
lt;!-- JavaServer Faces --gt;
lt;context-paramgt;
lt;param-namegt;org.richfaces.SKINlt;/param-namegt;
lt;param-valuegt;blueSkylt;/param-valuegt;
lt;/context-paramgt;
lt;context-paramgt;
lt;param-namegt;javax.faces.STATE_SAVING_METHODlt;/param-namegt;
lt;param-valuegt;serverlt;/param-valuegt;
lt;/context-paramgt;
lt;context-paramgt;
lt;param-namegt;javax.faces.CONFIG_FILESlt;/param-namegt;
lt;param-valuegt;/WEB-INF/faces-config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xmllt;/param-valuegt;
lt;/context-paramgt;
lt;context-paramgt;
lt;param-namegt;contextConfigLocationlt;/param-namegt;
lt;param-valuegt;
/WEB-INF/applicationContext.xml
/WEB-INF/applicationContext-security.xml
lt;/param-valuegt;
lt;/context-paramgt;
lt;filtergt;
lt;filter-namegt;RequestContextFilterlt;/filter-namegt;
lt;filter-classgt;
org..web.filter.RequestContextFilter
lt;/filter-classgt;
lt;/filtergt;
lt;filter-mappinggt;
lt;filter-namegt;RequestContextFilterlt;/filter-namegt;
lt;servlet-namegt;Faces Servletlt;/servlet-namegt;
lt;/filter-mappinggt;
lt;filtergt;
lt;filter-namegt;springSecurityFilterChainlt;/filter-namegt;
lt;filter-classgt;org..web.filter.DelegatingFilterProxy
lt;/filter-classgt;
lt;/filtergt;
lt;filter-mappinggt;
lt;filter-namegt;springSecurityFilterChainlt;/filter-namegt;
lt;ucl-patterngt;/*lt;/ucl-patterngt;
lt;/filter-mappinggt;
lt;context-paramgt;
lt;param-namegt;com.sun.faces.validateXmllt;/param-namegt;
lt;param-valuegt;truelt;/param-valuegt;
lt;/context-paramgt;
lt;filtergt;
lt;display-namegt;RichFaces Filterlt;/display-namegt;
lt;filter-namegt;richfaceslt;/filter-namegt;
lt;filter-classgt;org.ajax4jsf.Filterlt;/filter-classgt;
lt;/filtergt;
lt;filter-mappinggt;
lt;filter-namegt;richfaceslt;/filter-namegt;
lt;servlet-namegt;Faces Servletlt;/servlet-namegt;
lt;dispatchergt;REQUESTlt;/dispatchergt;
lt;dispatchergt;FORWARDlt;/dispatchergt;
lt;dispatchergt;INCLUDElt;/dispatchergt;
lt;/filter-mappinggt;
lt;listenergt;
lt;listener-classgt;com.sun.faces.config.ConfigureListenerlt;/listener-classgt;
lt;/listenergt;
lt;listenergt;
lt;listener-classgt;org..security.ui.session.fromSessionEventPublisherlt;/listener-classgt;
lt;/listenergt;
lt;!-- Faces Servlet --gt;
lt;servletgt;
lt;servlet-namegt;Faces Servletlt;/servlet-namegt;
lt;servlet-classgt;javax.faces.webapp.FacesServletlt;/servlet-classgt;
lt;load-on-startupgt;1lt;/load-on-startupgt;
lt;/servletgt;
lt;servletgt;
lt;servlet-namegt;SpringContextServletlt;/servlet-namegt;
lt;servlet-classgt;org..web.context.ContextLoaderServletlt;/servlet-classgt;
lt;load-on-startupgt;1lt;/load-on-startupgt;
lt;/servletgt;
lt;!-- Faces Servlet Mapping --gt;
lt;servlet-mappinggt;
lt;servlet-namegt;Faces Servletlt;/servlet-namegt;
lt;ucl-patterngt;*.jsflt;/ucl-patterngt;
lt;/servlet-mappinggt;
lt;listenergt;
lt;listener-classgt;org..web.context.ContextLoaderListenerlt;/listener-classgt;
lt;/listenergt;
lt;!-- Tomcat 4.1 can not read tld file from jar for jstl1.0 jarkata implementation. It's a workaround here. --gt;
lt;taglibgt;
lt;taglib-urigt;jstl/corelt;/taglib-urigt;
lt;taglib-locationgt;/WEB-INF/c.tldlt;/taglib-locationgt;
lt;/taglibgt;
lt;taglibgt;
lt;taglib-urigt;jsf/htmllt;/taglib-urigt;
lt;taglib-locationgt;/WEB-INF/html_basic.tldlt;/taglib-locationgt;
lt;/taglibgt;
lt;/web-appgt;Try putting your XML in a [ CODE ][ /CODE ] (without the spaces) section as it makes it easier to read.

i have put the XML files in [CODE].... didnt know ther was an option like that.. plz go thru my problem and suggest a soln plzz..
¥
Back Forum Reply New