我正在使用spring/spring-security 3.1并希望在用户注销时(或者如果会话超时)采取某些操作.我设法为注销完成了操作,但是对于会话超时,我无法使其正常工作.
在web.xml中我只指定了ContextLoaderListener(这可能是问题吗?),当然还有DelegatingFilterProxy.
我像这样使用自动配置.
<security:http auto-config="false" use-expressions="false">
<security:intercept-url pattern="/dialog/*"
access="ROLE_USERS" />
<security:intercept-url pattern="/boa/*"
access="ROLE-USERS" />
<security:intercept-url pattern="/*.html"
access="ROLE-USERS" />
<security:form-login login-page="/auth/login.html"
default-target-url="/index.html" />
<security:logout logout-url="/logout"
invalidate-session="true"
delete-cookies="JSESSIONID" success-handler-ref="logoutHandler" />
</security:http>
<bean id="logoutHandler" class="com.bla.bla.bla.LogoutHandler">
<property name="logoutUrl" value="/auth/logout.html"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
当用户单击注销时,将调用注销处理程序,这将调用数据库.
但是如何处理会话超时???
处理它的一种方法是在用户登录时将用户名注入会话,然后使用普通的httpsessionlistener并在会话超时时执行相同的操作.
弹簧安全性是否有类似的方式,因此当spring发现会话超时时,我可以在那里挂钩,访问Authentication并从那里获取UserDetails并进行清理.
我正在连接到具有axis/rampart的web服务,并被告知要删除InclusiveNamespaces,因为prefixList是"",这是不允许的.我怎么做?
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="wsa soapenv" />
</ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<ds:Reference URI="#Id-289005241">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="" />
</ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<ds:DigestValue>bla bla bla=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
Run Code Online (Sandbox Code Playgroud)
是否可以将轴/ rampart配置为在其为空时不打印包含名称空间?
我正在使用axis/rampart 1.6.2并连接到.NET服务
任何想法如何存档?或者我如何使它呈现非空前缀列表?
我遇到了从hibernate 3.6升级到4.0.1(从3到3.1的弹出)的问题.
我正在使用hibernateinterceptors在调用某些方法(例如OnMessage调用,Cron更新程序等)和Web请求的OpennSessionInView拦截器时注入会话.它已经与hib 3.6和spring 3.0一起工作正常,但是从hibernate4开始我无法使用它.hibernateInterceptor仅在hibernate3包中可用,并且使用它不会使它工作
任何想法我应该做什么?
删除拦截器的东西使我能够启动,但是一旦我尝试从不是来自Web的请求调用dao,我就会得到"No session bound exception".
有没有更好的方法拦截dao然后使用hibernate拦截器或我应该使用另一种技术?如上所述,我正在使用web请求中的dao(使用opensessioninview处理得很好),JMS OnMessage和SpringCron以及无法正常工作的初始化代码.
这是dao的基本设置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<bean id="someDao" class="org.springframework.aop.framework.ProxyFactoryBean"
p:target-ref="someDaoTarget" p:proxyInterfaces="com.xxxx.MediaDataDao"
p:interceptorNames="hibernateInterceptor" />
<bean id="someDaoTarget" class="com.xxxx.SomeDaoImpl"
p:sessionFactory-ref="sessionFactory" />
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="hibernateInterceptor"
class="org.springframework.orm.hibernate3.HibernateInterceptor"
p:sessionFactory-ref="sessionFactory" />
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
destroy-method="destroy"
p:dataSource-ref="dataSource">
<property name="packagesToScan"
value="com.xxxx" />
<property name="hibernateProperties" ref="hibernateProperties" …Run Code Online (Sandbox Code Playgroud)