Notes: glassfish 出现__admingui/common/index.jsp not found 的问题处理

这几天出现了一个奇怪的现象,glassfish的管理端“无缘无故”的登录不了了,查看server.log见以下错误:

File "%2Fopt%2Fglassfish3%2Fglassfish%2Flib%2Finstall%2Fapplications%2F__admingui%2Fcommon%2Findex.jsp" not found|#]

整理下:

File "/opt/glassfish3/glassfish/lib/install/applications/__admingui/common/index.jsp" not found|#]

这个是管理端的首页,更换了好几个全新的glassfish版本在服务器上的现象依旧,本地跑却一点儿事情没有,实在是不明白原因。

最后在这里:http://www.java.net/node/699754 得到了提示,一个叫 dcam 的家伙说:
继续阅读Notes: glassfish 出现__admingui/common/index.jsp not found 的问题处理

Spring Security 常用的几个自定义filter

<form-login authentication-success-handler-ref="afterLoginSuccessHandler" login-page="/loginPage.action?error=false" authentication-failure-url="/loginPage.action?error=true" default-target-url="/"/>

//配置自定义filter
<custom-filter before="FORM_LOGIN_FILTER" ref="authenticationProcessingFilter"/>
<custom-filter before="LOGOUT_FILTER" ref="logoutFilter"/>

//配置权限Provider
<authentication-manager alias="authenticationManager">
        <authentication-provider ref="securityAuthenticationProvider" />
</authentication-manager>

//自定义Provider
<beans:bean id="securityAuthenticationProvider" class="com.xxx.security.SecurityAuthenticationProvider">
        <beans:property name="userDetailsService" ref="securityUserService"/>
        <beans:property name="passwordEncoder" ref="passwordEncoder"/>
</beans:bean>

//配置AuthenticationFilter
<beans:bean id="authenticationProcessingFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter">
        <beans:property name="authenticationManager" ref="authenticationManager"/>
        <beans:property name="authenticationSuccessHandler" ref="afterLoginSuccessHandler"/>
        <beans:property name="authenticationFailureHandler" ref="afterLoginFailHandler"/>
        <beans:property name="authenticationDetailsSource" ref="authenticationDetailsSourceImpl"/>
</beans:bean>

//自定义LoginFailHandler
<beans:bean id="afterLoginFailHandler" class="com.xxx.security.AfterLoginFailHandler">
        <beans:property name="defaultFailureUrl">
            <beans:value>/loginPage.action?error=true</beans:value>
        </beans:property>
</beans:bean>

//自定义LoginSuccessHandler
<beans:bean id="afterLoginSuccessHandler" class="com.xxx.security.AfterLoginSuccessHandler">
        <beans:property name="defaultTargetUrl">
            <beans:value>/</beans:value>
        </beans:property>
</beans:bean>

//Md5加密
<beans:bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
    <beans:bean id="authenticationDetailsSourceImpl" class="org.springframework.security.authentication.AuthenticationDetailsSourceImpl">
        <beans:property name="clazz" value="com.xxx.security.SecurityWebAuthenticationDetails"/>
</beans:bean>

//自定义LogoutFilter
<beans:bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
        <beans:constructor-arg value="/" />
        <beans:constructor-arg>
            <beans:list>
                <beans:bean class="com.xxx.security.LogoutHandler"/>
            </beans:list>
        </beans:constructor-arg>
</beans:bean>