j_security_check for jsf app not working in IE

*爱你&永不变心* 提交于 2020-01-07 02:38:10

问题


I have a simple jsf app developed and working on tomcat 6.0.13. I added some security contraints to the entire application by adding the usual setting in web.xml.

When I now deploy the application to tomcat and check, it works absolutely fine in firefox, I get my Login.html rendered(code below) and once authorised takes me to the relevant page. When I navigate to the same app in IE, i get the login prompt as below but clicking on the Submit button doesn't do anything. It just stays there like it's not posting back to the server, as the server doesn't seem to get any response from the client browser(no errors, no logs, etc).

What am I doing wrong?

<html>
    <head>
        <style type="text/css">
            .cssGenericHeaderColumn
            {
                font-family: Verdana, Arial, Sans-Serif;
                font-size:14px;
                font-weight: bold; 
                text-align: left; 
                vertical-align: left;
            } 
            .cssGenericEntryLabel 
            {
                font-family: Verdana, Arial, Sans-Serif;
                font-size:13px;
                font-weight: lighter; 
                text-align: left; 
                vertical-align: top;
            }           
        </style>
    </head>
    <body>      
        <form method="POST" action="j_security_check">

        <table align="center">
            <tr>
                <td colspan="2" class="cssGenericHeaderColumn">
                    Welcome to blah blah
                </td> 
            </tr>
            <tr>
                <td class="cssGenericEntryLabel"> 
                    User name  
                </td>
                <td class="cssGenericEntryLabel">
                    <input type="text" name="j_username">


                </td> 
            </tr>
            <tr>
                <td class="cssGenericEntryLabel"> 
                    Password  
                </td>
                <td class="cssGenericEntryLabel">
                    <input type="password" name="j_password">
                </td> 
            </tr>
            <tr>
                <td> 
                </td>
                <td  class="cssGenericEntryLabel">
                    <button  class="cssGenericEntryLabel"> Submit </button>
                </td> 
            </tr>
        </table>
    </form>
</body>

Thanks


回答1:


You should be using <input type="submit"> or <button type="submit"> instead of a standard button to have a fullworthy submit button.

So, replacing

<button class="cssGenericEntryLabel">Submit</button>

by

<button type="submit" class="cssGenericEntryLabel">Submit</button>

or

<input type="submit" value="Submit" class="cssGenericEntryLabel" />

should fix your problem.

Please note that this problem is in no way related to JSF. It's just related to basic HTML.



来源:https://stackoverflow.com/questions/6531075/j-security-check-for-jsf-app-not-working-in-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!