开发者

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.

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. 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/*<开发者_StackOverflow中文版/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.

Any ideas?


The action="j_security_check" attribute on the form guarantees that he submit button will send you to 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.


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

it is not possible to style your page using JSF, if you are doing j_Security_check

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜