0

我想隐藏我的页面扩展而不使用漂亮的面孔,因为它很难使用,我对使用它感到困惑,现在我正在使用 tukey http://tukey.org/urlrewrite/

我有这个链接:localhost1:8080/control/login.xhtml

so i want it like : localhost1:8080/control/login

我的代码是:

<urlrewrite>

<rule>
    <note>
        The rule means that requests to /test/status/ will be redirected to /rewrite-status
        the url will be rewritten.
    </note>
    <from>login.xhtml</from>
    <to type="redirect">control/login</to>
</rule>

但它给了我:

HTTP Status 404 - /control/login
 for that link : 
 localhost:8080/control/login
4

1 回答 1

0

由于您要重定向到control/login,因此您还需要定义一个导航规则,将这个 url 映射到一个 xhtml 页面。

例子

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">


<navigation-rule>
<from-view-id>*.xhtml</from-view-id>
<navigation-case>
    <from-outcome>control/login</from-outcome>
    <to-view-id>login.xhtml</to-view-id>
</navigation-case>
</navigation-rule>


</faces-config>
于 2013-10-29T06:08:57.253 回答