myfaces/facelets 和acegi集成的问题

hateeyes 2007-08-20
我按照myfaces.apache.org/wiki 上的帮助配置的登录表单如下:
<h:form>
<t:inputText id="j_username" forceId="true" value="#{acegiBean.account}" size="40" maxlength="80"></t:inputText>
<t:inputSecret id="j_password" forceId="true" value="#{acegiBean.pwd}" size="40" maxlength="80" redisplay="true"></t:inputSecret>
<h:commandButton action="login" value="login"/>
<h:messages id="messages" layout="table" globalOnly="true" showSummary="true" showDetail="false"/>
</h:form>
配置文件如下:
web.xml的
<filter>
    <filter-name>Acegi Filter Chain Proxy</filter-name>
    <filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
   <init-param>
       <param-name>targetClass</param-name>
   <param-value>org.acegisecurity.util.FilterChainProxy</param-value>
   </init-param>
</filter>
<filter-mapping>
    <filter-name>Acegi Filter Chain Proxy</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
</filter-mapping>

然后faces-config.xml的配置如下
<managed-bean>
    <managed-bean-name>acegiBean</managed-bean-name>
    <managed-bean-class>org.myfaces.AcegiBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
    <from-view-id>/index.xhtml</from-view-id>
    <navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/j_acegi_security_check.xhtml</to-view-id>
    </navigation-case>
</navigation-rule>


applicationContext-security.xml的部分配置:


<bean id="authenticationProcessingFilter" class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter">
<property name="authenticationManager"><ref local="authenticationManager"/></property>
<property name="authenticationFailureUrl" value="/login.faces"></property>
<property name="defaultTargetUrl" value="/home.faces"></property>
<property name="filterProcessesUrl" value="/j_acegi_security_check.xhtml"></property>
<property name="reememberMeSrvices" ref="rememberMeServices"></property>
</bean>

现在问题是,我从表单填用户名和密码,提交之后就会提示说
/Myfaces/j_acegi_security_check.faces is not available
但是当我直接从浏览器直接输入
http://127.0.0.1:8080/Myfaces/j_acegi_security_check.faces 这个地址时,就会跳转到http://127.0.0.1:8080/Myfaces/login.faces  也就是认证失败转向的页面.好郁闷啊。。。
哪位大侠我啊。。。
hateeyes 2007-08-20
大侠大侠快出现吧
Global site tag (gtag.js) - Google Analytics