用的是Glassfish2.1 Enterprise服务器
没Login的时候,点击登录后可以正常认证。
但是当我点了浏览器的后退按钮再登录的时候
报了404错误。
调查了好久都弄不明白
web.xml
<security-constraint>
<display-name>OpenDS Constraint</display-name>
<web-resource-collection>
<web-resource-name>OpenDS Constraint</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>Authorized</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>OpenDS</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>All authorized users (with any group permission)</description>
<role-name>Authorized</role-name>
</security-role>login.jsp <body>
<h1>Login to XXXX</h1>
<form class="cssform" action="j_security_check" method="POST">
<p>
<label for="user">Username</label>
<input type="text" name="j_username" id="user">
</p>
<p>
<label for="pwd">Password</label>
<input type="password" name="j_password" id="pwd">
</p>
<input type="submit" value="Login">
</form>
</body>
没Login的时候,点击登录后可以正常认证。
但是当我点了浏览器的后退按钮再登录的时候
报了404错误。
调查了好久都弄不明白
web.xml
<security-constraint>
<display-name>OpenDS Constraint</display-name>
<web-resource-collection>
<web-resource-name>OpenDS Constraint</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>Authorized</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>OpenDS</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>All authorized users (with any group permission)</description>
<role-name>Authorized</role-name>
</security-role>login.jsp <body>
<h1>Login to XXXX</h1>
<form class="cssform" action="j_security_check" method="POST">
<p>
<label for="user">Username</label>
<input type="text" name="j_username" id="user">
</p>
<p>
<label for="pwd">Password</label>
<input type="password" name="j_password" id="pwd">
</p>
<input type="submit" value="Login">
</form>
</body>
正常的情况下是可以的
是因为点了浏览器的按钮之后才出现的错误。
而且Form认证的类并不是自己写的,配置一下就可以的不只是点后退,一次login之后再次认证的时候都会出错
大家没遇到过类似的问题吗?我想知道原因