【问题标题】:j_security_check for jsf app not working in IEj_security_check 的 jsf 应用程序在 IE 中不起作用
【发布时间】:2011-09-25 17:48:10
【问题描述】:

我在 tomcat 6.0.13 上开发了一个简单的 jsf 应用程序。通过在 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>

谢谢

【问题讨论】:

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


    【解决方案1】:

    您应该使用&lt;input type="submit"&gt;&lt;button type="submit"&gt; 而不是标准按钮来获得完整的提交按钮。

    所以,替换

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

    通过

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

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

    应该可以解决您的问题。

    请注意,这个问题与 JSF 无关。它只是与基本的 HTML 有关。

    【讨论】:

    猜你喜欢
    • 2011-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-12
    • 2012-02-20
    • 2011-06-23
    • 1970-01-01
    • 2011-08-16
    相关资源
    最近更新 更多