Maven 指定的XML文件没有任何关联的样式表

Maven 指定的XML文件没有任何关联的样式表,maven,jsf,tomcat,jakarta-ee,apache-tomee,Maven,Jsf,Tomcat,Jakarta Ee,Apache Tomee,我正在尝试修复,来自Tome邮件列表的人让我用Maven重现这个bug。 所以我跟着 我创建了一个新目录,然后输入命令 mvn archetype:generate -DarchetypeGroupId=org.apache.openejb.maven -DarchetypeArtifactId=tomee-webapp-archetype -DarchetypeVersion=1.0.1 然后 然后 然后我推杆 在 并尝试加载网页 http://localhost:8080/LAI_pezz

我正在尝试修复,来自Tome邮件列表的人让我用Maven重现这个bug。 所以我跟着

我创建了一个新目录,然后输入命令

mvn archetype:generate -DarchetypeGroupId=org.apache.openejb.maven -DarchetypeArtifactId=tomee-webapp-archetype -DarchetypeVersion=1.0.1
然后

然后

然后我推杆 在

并尝试加载网页

http://localhost:8080/LAI_pezzi_Login/Login.xhtml
但我明白了

The specified XML file does not have any associated style sheet. Document tree is shown below

<ui:composition template="/templates/layout.xhtml">
<ui:define name="content">
<h:form styleClass="loginPanelStyle">
<p:growl id="msgs" showDetail="true" sticky="false"/>
<p:panelGrid columns="2">
<f:facet name="header"> Login Panel </f:facet>
<h:outputText value="Username : "/>
<p:inputText id="username" value="#{loginController.username}" required="true" requiredMessage="Please Enter Username!" message="fc">
<f:validateLength minimum="1"/>
</p:inputText>
<h:outputText value="Password : "/>
<p:password id="password" value="#{loginController.password}" required="true" requiredMessage="Please Enter password!">
<f:validateLength minimum="1"/>
</p:password>
<f:facet name="footer">
<p:commandButton value="Submit" update="msgs" actionListener="#{loginController.login}" icon="ui-icon-check" style="margin:0"/>
</f:facet>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>
指定的XML文件没有任何关联的样式表。文档树如下图所示
登录面板

我还尝试将WAR文件部署在从Apache网站下载的Tomcat上,WAR文件工作正常

如评论中所述,您需要通过在
web.xml
中指定servlet映射来告诉JSF应该处理哪些URL:

<servlet-mapping>
  <servlet-name>FacesServlet</servlet-name>
  <url-pattern>*.xhtml<‌​/url-pattern>
</servlet-mapping>

小脸蛋
*.xhtml

您对遗留配置文件的经验提醒了我,为什么我只使用10'杆触碰maven。

您没有加载和/或映射JSF(更具体地说是faces servlet)。WAR文件不应该是“即插即用”的吗?我的意思是,这场战争来自Eclipse中一个运行良好的项目。当我开始在Eclipse中浏览时,网页加载正确。我该怎么办呢?看看,添加servlet映射(您可能希望在演示中使用扩展映射)可以解决您的问题吗?您是指web.xml文件吗?我不知道什么是扩展映射是的,这就是我链接的教程的内容。它基本上添加了一个
FacesServlet*.xhtml
http://localhost:8080/LAI_pezzi_Login/Login.xhtml
The specified XML file does not have any associated style sheet. Document tree is shown below

<ui:composition template="/templates/layout.xhtml">
<ui:define name="content">
<h:form styleClass="loginPanelStyle">
<p:growl id="msgs" showDetail="true" sticky="false"/>
<p:panelGrid columns="2">
<f:facet name="header"> Login Panel </f:facet>
<h:outputText value="Username : "/>
<p:inputText id="username" value="#{loginController.username}" required="true" requiredMessage="Please Enter Username!" message="fc">
<f:validateLength minimum="1"/>
</p:inputText>
<h:outputText value="Password : "/>
<p:password id="password" value="#{loginController.password}" required="true" requiredMessage="Please Enter password!">
<f:validateLength minimum="1"/>
</p:password>
<f:facet name="footer">
<p:commandButton value="Submit" update="msgs" actionListener="#{loginController.login}" icon="ui-icon-check" style="margin:0"/>
</f:facet>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>
<servlet-mapping>
  <servlet-name>FacesServlet</servlet-name>
  <url-pattern>*.xhtml<‌​/url-pattern>
</servlet-mapping>