gpt4 book ai didi

java - 接缝FORM问题

转载 作者:行者123 更新时间:2023-12-01 05:40:57 25 4
gpt4 key购买 nike

我有一个简单的表单方法...

<form method="POST" action="j_security_check">
<table>
<tr>
<td>Name:</td>
<td><input type="text" name="j_username" /></td>
</tr>
<tr style="margin-top: 10px;">
<td>Password:</td>
<td><input type="password" name="j_password" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Go" /></td>
</tr>
</table>
</form>

此页面位于login.xhtml中。

当用户输入错误的信息时,它会将我重新路由到j_security_check.html,并且当它这样做时,它会丢失所有样式。有办法解决这个问题吗?

使登录出现的资源:

<login-config>
<auth-method>CLIENT-CERT,FORM</auth-method>
<form-login-config>
<form-login-page>/login.seam</form-login-page>
<form-error-page>/login.seam</form-error-page>
</form-login-config>
</login-config>

此外,可访问的数据是:

<security-constraint>
<web-resource-collection>
<web-resource-name>Accessible Data</web-resource-name>
<url-pattern>/login</url-pattern>
<url-pattern>/a4j/*</url-pattern>
<url-pattern>/css/*</url-pattern>
<url-pattern>/img/*</url-pattern>
</web-resource-collection>
</security-constraint>

当我查看 View 源代码时,似乎登录页面源代码已加载所有 CSS 和属性,但 j_security_check 页面没有。

有什么想法吗?

最佳答案

表单上的 action="j_security_check" 属性保证他的提交按钮会将您发送至 j_security_check。您可能想要做的是将 j_security_check 处理程序重定向回 login.xhtml 以让用户尝试再次输入其凭据。

关于java - 接缝FORM问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7197535/

25 4 0
文章推荐: java - Jpanel Paint中的空指针异常
文章推荐: python - RSA 解密去除前导空字节
文章推荐: jquery - 未捕获的类型错误 : Object # has no method 'validate'