Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JSF与容器管理安全_Jsf_Authentication_Jakarta Ee - Fatal编程技术网

JSF与容器管理安全

JSF与容器管理安全,jsf,authentication,jakarta-ee,Jsf,Authentication,Jakarta Ee,我有一个JSF登录页面,当用户直接导航到它时,它工作得非常好 但是,如果用户在没有先登录的情况下尝试访问受保护的页面,则容器会正确地拦截该页面并将其抛出到登录页面。但是,由于登录页面是JSF,因此存在一个问题。发送给用户的是原始JSF页面,完全未经FacesServlet处理 代码段示例-在未登录的情况下访问受保护页面后发送到浏览器: <ui:define name="body"> <p:growl id="growl" showDetail="true" sticky

我有一个JSF登录页面,当用户直接导航到它时,它工作得非常好

但是,如果用户在没有先登录的情况下尝试访问受保护的页面,则容器会正确地拦截该页面并将其抛出到登录页面。但是,由于登录页面是JSF,因此存在一个问题。发送给用户的是原始JSF页面,完全未经FacesServlet处理

代码段示例-在未登录的情况下访问受保护页面后发送到浏览器:

<ui:define name="body">
    <p:growl id="growl" showDetail="true" sticky="true"  /> 
    <div class="mytext">Please login to the application...</div>

    <form method="POST" action="j_security_check">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td align="right">Username:&nbsp;</td>
                <td>
                    <input type="text" name="j_username"/>
                </td>
            </tr>
            <tr>
                <td align="right">Password:&nbsp;</td>
                <td>
                    <input type="password" name="j_password"/>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <input type="submit" value="Login"/>
                 </td>
             </tr>
            </table>
     </form>
 </ui:define>

请登录到应用程序。。。
用户名:
密码:

有没有办法强迫容器通过FacesServlet处理器呈现响应,而不是简单地返回原始JSF文件?

或者更改
的URL以匹配
FacesServlet
的URL模式,或者更好,将
FacesServlet
的URL模式更改为
*.xhtml
,这样最终用户就永远无法通过故意更改浏览器地址栏中的URL来查看任何页面的原始JSF源代码。

或者更改
的URL以匹配
FacesServlet
的URL模式,或者更好,将
FacesServlet
的URL模式更改为
*.xhtml
,以便最终用户通过故意更改浏览器地址栏中的URL,永远看不到任何页面的原始JSF源代码