小编Wil*_*son的帖子

如何在多个Java应用程序之间共享连接池

我在单个服务器上实现了几个JavaSE应用程序.是否可以设置单个连接池(例如C3P0)并在这些应用程序之间共享?我只是希望有一种简单的方法来管理数据库连接的总数.

使用这种集中连接池有什么缺点吗?

谢谢,威尔逊

java connection-pooling

6
推荐指数
1
解决办法
1706
查看次数

使用CAS + Spring Security实现SSO

我正在尝试使用CAS和Spring Security在多个Web应用程序中实现SSO.预期案例:
CAS - http:// localhost:8080/cas/
App受
保护的内容 - http://localhost:8081/ cas-client1/secure/ index.html App B受保护的内容 - http:// localhost:8081/CAS-客户机程序/安全/ index.html的

1)当用户访问cas-client1时,将提示CAS登录表单并触发认证.
2)相同的用户访问cas-client2,应该识别以前的登录,并且不会提示登录表单

但是,我未能执行第2步.CAS登录表单仍然提示用户,因此需要双重登录.我的Spring Security配置中是否有任何错误设置:

  <security:http entry-point-ref="casAuthenticationEntryPoint" auto-config="true">
    <security:intercept-url pattern="/secure/**" access="ROLE_USER" />
    <security:custom-filter position="CAS_FILTER" ref="casAuthenticationFilter" />
  </security:http>

  <bean id="casAuthenticationEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint">
    <property name="loginUrl" value="http://localhost:8080/cas/login" />
    <property name="serviceProperties" ref="serviceProperties" />
  </bean>

  <bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties">
    <!-- http://localhost:8081/cas-client2 for app 2-->
    <property name="service" value="http://localhost:8081/cas-client1/j_spring_cas_security_check" />
  </bean>

  <security:authentication-manager alias="authenticationManager">
    <security:authentication-provider ref="casAuthenticationProvider" />
  </security:authentication-manager>

  <bean id="casAuthenticationFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter">
    <property name="authenticationManager" ref="authenticationManager" />
    <property name="authenticationFailureHandler">
      <bean class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">
        <property name="defaultFailureUrl" value="/casfailed.jsp" /> …
Run Code Online (Sandbox Code Playgroud)

java cas spring-security single-sign-on

6
推荐指数
1
解决办法
9653
查看次数