I am using Strut2 with Tiles along with Spring security and Spring MVC. I am new to Spring Security and Spring MVC.
I am getting the following Error:
There is no Action mapped for namespace / and action name spring_security_login. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:189)
at org.apache.struts2.impl.StrutsActionProxy.prepare( StrutsActionProxy.java:61)...
Please see my web.xml file:
<web-app>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.Stru tsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
</listener>
<listener>
<listener-class>
org.apache.struts2.tiles.StrutsTilesListener
</listener-class>
</listener>
<context-param>
<param-name>tilesDefinitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
/WEB-INF/applicationContext-security.xml
</param-value>
</context-param>
</web-app>
Please see my applicationContext-security.xml file
<global-method-security pre-post-annotations="enabled">
</global-method-security>
<http use-expressions="true">
<intercept-url pattern="/**" access="hasRole('ROLE_USER')" />
<form-login />
<logout />
<!-- Uncomment to limit the number of sessions a user can have -->
<session-management invalid-session-url="/timeout.jsp">
<concurrency-control max-sessions="1" error-if-maximum-exceeded="true" />
</session-management>
</http>
<authentication-manager>
<authentication-provider>
<password-encoder hash="plaintext"/>
<user-service>
<user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
<user name="guest" password="guest" authorities="ROLE_USER" />
</user-service>
</authentication-provider>
</authentication-manager>
What should I do to have struts.xml file or Strut2 to forward the action spring_security_login to Spring security and display the loginpage?? Any help appreciated



Reply With Quote