简体   繁体   English

缝形式问题

[英]Seam FORM problem

I have a simple form method... 我有一个简单的表格方法...

<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>

This page is in login.xhtml . 此页面位于login.xhtml

When the user enters the wrong information it re-routes me to j_security_check.html , and when it does, it loses all of it's styling. 当用户输入错误的信息时,它会将我重新j_security_check.htmlj_security_check.html ,当输入错误的信息时,它将失去所有样式。 Is there a way around this? 有没有解决的办法?

Resource to make login appear: 显示登录资源:

<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>

In addition, accessible data is: 另外,可访问的数据是:

<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>

When I look inside the view source, it seems that the login page source has all the CSS and attributes loaded, but the j_security_check page doesn't. 当我查看视图源时,似乎登录页面源已加载了所有CSS和属性,但j_security_check页面却没有。

Any ideas? 有任何想法吗?

The action="j_security_check" attribute on the form guarantees that he submit button will send you to j_security_check. 表单上的action="j_security_check"属性保证他的提交按钮会将您发送到j_security_check。 What you probably want to do is have your handler for j_security_check redirect back to login.xhtml to let the user try entering their credentials again. 您可能想要做的是让j_security_check的处理程序重定向回到login.xhtml以使用户尝试再次输入其凭据。

http://www.coderanch.com/t/448131/JSF/java/forms-authentication-security-check-JSF has the answer http://www.coderanch.com/t/448131/JSF/java/forms-authentication-security-check-JSF有答案

it is not possible to style your page using JSF, if you are doing j_Security_check 如果正在执行j_Security_check,则无法使用JSF设置页面样式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM