Java 欢迎文件列表中包含不同文件的web.xml

Java 欢迎文件列表中包含不同文件的web.xml,java,xml,jsf,jsf-2,web.xml,Java,Xml,Jsf,Jsf 2,Web.xml,我开始使用JSF,我有点迷路了。我正在开发一个JSF应用程序,我有两个切入点 有时我需要浏览器打开一个名为mydata.xhtml的页面,有时我需要打开一个名为dataexchange.xhtml的页面 现在我已经完成了第一个,应用程序运行良好。我想我必须更改我的web.xml文件,不是吗 我的web.xml就是这样 <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns

我开始使用JSF,我有点迷路了。我正在开发一个JSF应用程序,我有两个切入点

有时我需要浏览器打开一个名为mydata.xhtml的页面,有时我需要打开一个名为dataexchange.xhtml的页面

现在我已经完成了第一个,应用程序运行良好。我想我必须更改我的web.xml文件,不是吗

我的web.xml就是这样

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/mydata.xhtml</welcome-file>
    </welcome-file-list>
</web-app></pre>

javax.faces.PROJECT_阶段
发展
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
/面孔/*
30
faces/mydata.xhtml

我认为web.xml中没有
if-else
逻辑选项

   <welcome-file-list>
        <welcome-file>faces/mydata.xhtml</welcome-file>
        <welcome-file>faces/dataexchange.xhtml</welcome-file>
    </welcome-file-list>
) 您可以从servlet返回您想要的xhtml

Either some framework provided or custom servlet with load on startup 1