My problem is , if I remove the configuration of Spring Security from my web.xml then my page is normally working. But if I put the configuration to use spring security, the action queryUsers is not fired so my page is not working properly.
Couldn't find a way to solve this, thank you for your time.
Here is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://ift.tt/19L2NlC"
xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/19L2NlC http://ift.tt/1drxgYl"
version="3.1">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
/WEB-INF/security-context.xml
</param-value>
</context-param>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>casablanca</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<welcome-file-list>
<welcome-file>pages/index.xhtml</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.jsf</url-pattern>
<url-pattern>*.faces</url-pattern>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<filter>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>com.software.cm.others.filters.CharacterEncodingFilter</filter-class>
</filter>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Here is my spring-security config xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://ift.tt/GArMu6"
xmlns:xsi="http://ift.tt/ra1lAU"
xmlns:security="http://ift.tt/1c8inpe"
xsi:schemaLocation="http://ift.tt/GArMu6
http://ift.tt/1jdM0fG
http://ift.tt/1c8inpe
http://ift.tt/18sW2ay">
<security:authentication-manager>
<security:authentication-provider>
<security:user-service>
<security:user name="mesut" authorities="ROLE_ADMIN" password="mesutdeneme"/>
<security:user name="can" authorities="ROLE_ADMIN" password="candeneme"/>
</security:user-service>
</security:authentication-provider>
</security:authentication-manager>
<security:http auto-config="true" use-expressions="true">
<security:form-login />
<security:intercept-url pattern="/**" access="hasRole('ROLE_ADMIN')"/>
</security:http>
</beans>
Here is my XHTML file
<ui:composition template="/pages/admin/admin.xhtml"
xmlns="http://ift.tt/lH0Osb"
xmlns:ui="http://ift.tt/KsEgXx"
xmlns:f="http://ift.tt/HcrI1S"
xmlns:h="http://ift.tt/HjFrZb"
xmlns:p="http://ift.tt/HjFrZc">
<ui:define name="center">
<h:form id="updateuserform">
<p:panel id="pnlUpdateUser" header="#{menu['menu.admin.usermanager.updateuser']}">
<p:panelGrid columns="2" styleClass="cm_ui-panel-grid">
<p:outputLabel value="#{menu['menu.admin.createuser.name']}" styleClass="cm_ui-output-label"/>
<p:inputText styleClass="cm_input-text" value="#{userMB.userQuery.name}"/>
<p:outputLabel value="#{menu['menu.admin.createuser.surname']}" styleClass="cm_ui-output-label"/>
<p:inputText styleClass="cm_input-text" value="#{userMB.userQuery.surname}" />
<f:facet name="footer">
<p:commandButton value="#{menu.search}" actionListener="#{userMB.queryUsers}" update=":resultform"/>
</f:facet>
</p:panelGrid>
</p:panel>
</h:form>
<h:form id="resultform">
<p:dataTable id="userresulttable" var="u" value="#{userMB.users}"
rendered="#{(userMB.users.size() > 0)}">
<f:facet name="header">
<p:outputLabel value="#{menu['menu.admin.updateuser.list']}"/>
</f:facet>
<p:column headerText="#{menu['menu.admin.createuser.id']}">
<h:outputText value="#{u.id}" />
</p:column>
<p:column headerText="#{menu['menu.admin.createuser.name']}">
<h:outputText value="#{u.name}" />
</p:column>
<p:column headerText="#{menu['menu.admin.createuser.surname']}">
<h:outputText value="#{u.surname}" />
</p:column>
<p:column headerText="#{menu['menu.admin.createuser.grade']}">
<h:outputText value="#{u.grade}" />
</p:column>
<p:column style="width:32px;text-align: center">
<p:commandButton update=":userupdateform:useredit" oncomplete="PF('userEditDialog').show()" icon="ui-icon-pencil" title="#{menu.update}">
<f:setPropertyActionListener value="#{u}" target="#{userMB.selectedUser}" />
</p:commandButton>
</p:column>
</p:dataTable>
</h:form>
</ui:define>
<ui:define name="dialog">
<h:form id="userupdateform">
<p:dialog id="useredit" header="Guncelleme" widgetVar="userEditDialog" modal="true"
showEffect="fade" hideEffect="fade" resizable="false">
<p:outputPanel style="text-align:center">
<p:panelGrid columns="2" rendered="#{userMB.selectedUser != null}" columnClasses="label,value">
<h:outputText value="Ad" />
<h:outputText value="#{userMB.selectedUser.name}" />
<h:outputText value="Soyad:" />
<h:outputText value="#{userMB.selectedUser.surname}" />
<h:outputText value="Unvan" />
<h:outputText value="#{userMB.selectedUser.grade}" />
</p:panelGrid>
</p:outputPanel>
</p:dialog>
</h:form>
</ui:define>
</ui:composition>
Aucun commentaire:
Enregistrer un commentaire