【发布时间】:2013-06-12 03:25:35
【问题描述】:
目前我的 Spring 应用程序只接受 HTTPS 协议的请求。以下是security-context.xml的一部分
<http auto-config="false" use-expressions="true"
disable-url-rewriting="true">
<intercept-url pattern="/signup*" access="permitAll"
requires-channel="https" />
<intercept-url pattern="/login*" access="permitAll"
requires-channel="https" />
<intercept-url pattern="/logout" access="permitAll"
requires-channel="https" />
<form-login authentication-success-handler-ref="myAuthenticationSuccessHandler"
login-page="/login" authentication-failure-url="/loginFailed" />
<intercept-url pattern="/**" access="isFullyAuthenticated()"
requires-channel="https" />
<session-management
session-authentication-error-url="/loginFailed">
<concurrency-control error-if-maximum-exceeded="true"
max-sessions="2" />
</session-management>
<logout invalidate-session="true" delete-cookies="JSESSIONID" />
</http>
现在,我还希望应用程序能够在用户访问域时将 HTTP GET 请求重定向到 HTTPS,例如从 http://mydomain.com 到 https://mydomain.com。我怎样才能做到这一点?我应该在 security-context.xml、控制器还是 Tomcat 本身中应用更改?
【问题讨论】:
标签: tomcat spring-mvc