j_security_check for jsf app在IE中不起作用

时间:2011-06-30 07:01:00

标签: internet-explorer firefox jsf tomcat6 j-security-check

我有一个简单的jsf应用程序开发并在tomcat 6.0.13上工作。我通过在web.xml中添加常用设置为整个应用程序添加了一些安全约束。

当我现在将应用程序部署到tomcat并检查时,它在firefox中运行得非常好,我得到了我的Login.html渲染(下面的代码),一旦授权将我带到相关页面。当我导航到IE中的同一个应用程序时,我得到如下的登录提示,但点击提交按钮不会做任何事情。它只是停留在那里,因为它没有回发到服务器,因为服务器似乎没有从客户端浏览器得到任何响应(没有错误,没有日志等)。

我做错了什么?

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

由于

1 个答案:

答案 0 :(得分:1)

您应该使用<input type="submit"><button type="submit">而不是标准按钮来提供完整的提交按钮。

所以,替换

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

通过

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

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

应该解决你的问题。

请注意,此问题与JSF无关。它与基本HTML有关。

相关问题