Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.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中将两个不同的URL指向同一页面_Jsf_Url_Navigation - Fatal编程技术网

在JSF中将两个不同的URL指向同一页面

在JSF中将两个不同的URL指向同一页面,jsf,url,navigation,Jsf,Url,Navigation,我正在使用以下文件系统开发jsf2+spring3应用程序: webapp -resources (folder) -WEB-INF (folder) --applicationContext.xml --faces-config.xml --web.xml -buy.xhtml -company.xhtml -home.xhtml -sell.xhtml 我在我的web.xml中得到了这个: <welcome-file-list> <welcome

我正在使用以下文件系统开发jsf2+spring3应用程序:

webapp
-resources (folder)
-WEB-INF (folder)
   --applicationContext.xml
   --faces-config.xml
   --web.xml
-buy.xhtml
-company.xhtml
-home.xhtml
-sell.xhtml
我在我的web.xml中得到了这个:

<welcome-file-list>
    <welcome-file>home.jsf</welcome-file>
</welcome-file-list>

<servlet>
    <servlet-name>facesServlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>facesServlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>facesServlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

home.jsf
小脸蛋
javax.faces.webapp.FacesServlet
1.
小脸蛋
*.jsf
小脸蛋
*.xhtml
我的faces-config.xml对导航一无所知

当我转到以下URL“http://:8080/website/”时,我得到了“home.jsf”视图。 当我编写以下URL“http://:8080/website/home.jsf/”时,我需要转到相同的“home.jsf”视图“http://:8080/website/caminha/”


我怎样才能做到这一点?我需要在web.xml或faces-config.xml中更改什么?谢谢

我需要在web.xml或faces-config.xml中更改什么?没有什么。如果没有添加更多内容,则可以通过或仅通过普通的
过滤器
来处理此问题。或者将home.xhtml添加到所需的文件夹(caminha)中,不再执行任何操作。