我使用的是JSF 2.2和primefaces 5.0
我想摆脱"面孔"在应用程序链接中。
所以我更改了web.xml并设置了url-pattern
:
从:
<url-pattern>/faces/*</url-pattern>
为:
<url-pattern>*.xhtml</url-pattern>
这确实有效并且消除了丑陋的面孔&#34;在链接中, 但我失去了主要的css风格!
我使用错误的方法删除&#34;面孔&#34;? 或者有没有办法让primefaces再次使用它?
编辑: 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>
<servlet-name>report</servlet-name>
<servlet-class>report</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>report</servlet-name>
<url-pattern>/report</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
300
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>