我正在尝试解决GWT中的URL登录问题。我们正在使用弹簧安全。问题是,所有的东西都在开发模式下工作,但是在Tomcat中以WAR的形式构建时失败了。使用Spring的GWT登录 - URL问题
应用程序上下文的security.xml seetings:
<form-login authentication-success-handler-ref="mySuccessHandler" authentication-failure-handler-ref="myFailureHandler" login-processing-url="/login" />
我有我自己的login.html文件中有SI HTML表单元素<form action="/login">
我有两个春天处理其重定向到的login.html或MyApplication.html(内容,服务)取决于用户是否认证。
如果我将我的应用程序打包到vsp.war(localhost:8080/vsp /)并运行它,它会转到Login.html,这是正确的。但是,如果我进行身份验证,它总是会进入localhost:8080 /登录状态为404。
我的最终WAR结构为:
- 登录
- login.nocache.js
- VSP
- vsp.nocache.js
- 登录。 html
- MyApplication.html
我有一个登录名和应用(服务)的其余两个模块。失败的认证处理方法的
例子:
@Override
public void onAuthenticationFailure(HttpServletRequest request,
HttpServletResponse response, AuthenticationException exception)
throws IOException, ServletException {
// always send HTTP 403
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
final StringBuilder URL = new StringBuilder("Login.html?");
if(!GWT.isProdMode()) {
URL.append("gwt.codesvr=127.0.0.1:9997&");
}
URL.append("error=true");
response.sendRedirect(URL.toString());
}
任何人可以帮助我在哪里,我在做错误?问题是如果必须有/Login.html或Login.html ot/login或其他不同的东西,我不明白URL。
任何帮助将不胜感激。
关注Lukas
请问ypu可以显示你的登录servlet如何映射到web.xml中? – 2013-02-21 10:49:26
我没有在web.xml中关于登录任何东西,仅仅只有春季安全: \t \t springSecurityFilterChain过滤器名称> \t \t <过滤器类> org.springframework.web.filter。的DelegatingFilterProxy滤波器级> \t \t <滤波器映射> \t \t springSecurityFilterChain过滤器名称> \t \t /* URL模式> \t过滤器映射> –
Gondri
2013-02-21 12:27:04