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



我正在尝试修复https://stackoverflow.com/questions/questions/21162117/simplecrud-rejects-pass-pass-password和来自Tomee邮件列表中的伙计们,要求我使用maven来重现该错误。所以我遵循Apache指南

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

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

然后

cd tomee-demo

然后

mvn package tomee:run

然后我放了战争档案在

maven/tomee-demo/target/apache-tomee/webapps/

尝试加载网页

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>

我还尝试在从Apache网站下载的tomcat上部署战争文件,而战争文件正常工作

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

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

您在左配置文件中的经验提醒我为什么我只用10'杆触摸maven。

最新更新