在配置中加了spingsecruty登陆不进去了,求助啊哪位大大帮帮我

圣诞老人123 2009-11-26 11:54:33
我在我的配置文件中加入了http https信道安全的内容,不加前登陆能等进去,加了后登不进去了 报bad certificate 错误怎么解决。
Spring-security.xml
<?xml version="1.0" encoding="UTF-8"?>
<b:beans xmlns="http://www.springframework.org/schema/security"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:b="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">

<http auto-config='true' session-fixation-protection="migrateSession" access-denied-page="/accessDenied.jsp">
<!-- <intercept-url pattern="/index.html" access="IS_AUTHENTICATED_ANONYMOUSLY" />-->
<!-- <intercept-url pattern="/login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY" />-->
<!-- <intercept-url pattern="/admin.jsp" access="ROLE_ADMIN" />-->
<!-- <intercept-url pattern="/**" access="ROLE_USER" />-->
<!-- <intercept-url pattern="/user.jsp" access="ROLE_USER"/>-->
<form-login login-page="/login.jsp"
authentication-failure-url="/login.jsp?error=true"
default-target-url="/loginSuccess.jsp" />
<logout logout-success-url="/index.html"/>
<concurrent-session-control max-sessions="1"/>
</http>


<global-method-security secured-annotations="enabled" jsr250-annotations="enabled">
<protect-pointcut access="ROLE_ADMIN" expression="execution(* com.Tony.*server.*(..))"/>
</global-method-security>
<b:bean id="channelProcessingFilter" class="org.springframework.security.securechannel.ChannelProcessingFilter">
<custom-filter before="SESSION_CONTEXT_INTEGRATION_FILTER" />
<b:property name="channelDecisionManager" ref="channelDecisionManager"/>
<b:property name="filterInvocationDefinitionSource">
<b:value>
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
\A/login.jsp.*\Z=REQUIRES_SECURE_CHANNEL
\A.*\Z=REQUIRES_INSECURE_CHANNEL
</b:value>
</b:property>
</b:bean>

<b:bean id="channelDecisionManager" class="org.springframework.security.securechannel.ChannelDecisionManagerImpl">
<b:property name="channelProcessors">
<b:list>
<b:ref bean="secureChannelProcessor"/>
<b:ref bean="insecureChannelProcessor"/>
</b:list>
</b:property>
</b:bean>

<b:bean id="secureChannelProcessor" class="org.springframework.security.securechannel.SecureChannelProcessor"/>
<b:bean id="insecureChannelProcessor" class="org.springframework.security.securechannel.InsecureChannelProcessor"/>


<b:bean id="filterSecurityInterceptor"
class="org.springframework.security.intercept.web.FilterSecurityInterceptor" autowire="byType">
<custom-filter before="FILTER_SECURITY_INTERCEPTOR" />
<b:property name="objectDefinitionSource" ref="filterInvocationDefinitionSource" />
</b:bean>

<b:bean id="filterInvocationDefinitionSource"
class="JdbcFilterInvocationDefinitionSourceFactoryBean">
<b:property name="dataSource" ref="dataSource"/>
<b:property name="resourceQuery" value="
select res, role from phpbb_role_res
"/>
</b:bean>


<authentication-provider>
<password-encoder hash="md5"></password-encoder>
<jdbc-user-service data-source-ref="dataSource"
users-by-username-query=
"select username, user_password,user_enable from phpbb_users where username=?"
authorities-by-username-query=
"select username, user_role from phpbb_users where username=?"/>
</authentication-provider>

<b:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<b:property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<b:property name="url" value="jdbc:mysql://localhost:3306/phpbb3"/>
<b:property name="username" value="root"/>
<b:property name="password" value="123"/>
</b:bean>


</b:beans>

WEB.XML

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>HelloWorld</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>


<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- 装载spring-security.xml开始 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<listener>
<listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher
</listener-class>
</listener>

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring-security.xml
</param-value>
</context-param>
<!--装载spring-security.xml结束 -->


</web-app>
...全文
44 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
圣诞老人123 2009-11-26
  • 打赏
  • 举报
回复
拜托了那位大大看下

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧