struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wsncqs <wsn...@aol.com>
Subject Struts2 + SHIRO, struts action can't get the values from submit page
Date Sun, 11 Dec 2011 06:06:00 GMT
*I get a problem when combine struts &shiro &spring , the struts
LoginAction can't get the values form the submit page(login.jsp),when apply
shiro filter(shiroFilter).when I comment  the shiro filter,it Transfer
values successfully.  how to solve this problem?*
*web.xml*
        <filter>
                <filter-name>StrutsPrepareFilter</filter-name>
               
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
        </filter>
        <filter>
                <filter-name>shiroFilter</filter-name>
               
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
                <init-param>
                        <param-name>targetFilterLifecycle</param-name>
                        <param-value>true</param-value>
                </init-param>
        </filter>
        <filter>
                <filter-name>StrutsExecuteFilter</filter-name>
               
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
        </filter>
        <filter-mapping>
                <filter-name>StrutsPrepareFilter</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
        <filter-mapping>
                <filter-name>shiroFilter</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping> 
        <filter-mapping>
                <filter-name>StrutsExecuteFilter</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
*login.jsp*
                <s:form action="login">
                        <s:textfield label="用户名" key="username" />
                        <s:password label="密码" key="password" />
                        <s:checkbox label="记住我" key="rememberMe" />
                        <s:submit value="登录" />
                </s:form>
*shiroFilter Filter in applicationContext.xml(Spring)*
<bean id="shiroFilter"
class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
                <property name="securityManager" ref="securityManager" />
                <property name="loginUrl" value="/login" />
                <property name="successUrl" value="/home" />
                <property name="unauthorizedUrl" value="/unauthorized" />
               
                <property name="filters">
                        <util:map>
                                <entry key="authc">
                                        <bean
                                               
class="org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter" />
                                </entry>
                        </util:map>
                </property>
                <property name="filterChainDefinitions">
                        <value>
                                /signup = anon
                                / =anon
                                /index.action = anon
                                /manageUsers = perms[user:manage]
                                /** = authc
                        </value>
                </property>
        </bean>

somebody meet the same problem too? or give me some advice ,thanks... 

--
View this message in context: http://struts.1045723.n5.nabble.com/Struts2-SHIRO-struts-action-can-t-get-the-values-from-submit-page-tp5065446p5065446.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message