Jsf 尽管部署描述符看起来正确,但通过Glassfish 3未解析内容
我在GlassFish 3域的自动部署中加入了一个war,它已经很好地爆炸了,显示了一个子目录树domain1>applications>myApp,下面是一个WEB-INF>classes>myApp文件夹树,其中存储了myApp的类 该应用程序最初使用JSF1.2和Facelets(1.1.15),并部署到Tomcat6,但我现在正在尝试使用JavaEE6和GlassFishV3进行构建 我知道JavaEE6上有JSF2和Facelets,所以我从我的应用程序库中去掉了所有不必要的JAR,留下了RichFaces、Log4J JAR和一些支持应用程序所需的Apache commons JAR 应用程序已部署,但我遇到了以下问题: 一旦应用程序部署,index.xhtml JSF文件就会加载。页面内容显示为未解析,因为richfaces和jsf标记被忽略,尽管整个文件被发送到浏览器。整个页面封装在ui:composition-facelets标记中。我读到这是因为页面没有通过FacesServlet。如果部署描述符确实存在问题,有人能建议我需要对它们做些什么来实现这一点吗 我的Jsf 尽管部署描述符看起来正确,但通过Glassfish 3未解析内容,jsf,servlets,glassfish,richfaces,facelets,Jsf,Servlets,Glassfish,Richfaces,Facelets,我在GlassFish 3域的自动部署中加入了一个war,它已经很好地爆炸了,显示了一个子目录树domain1>applications>myApp,下面是一个WEB-INF>classes>myApp文件夹树,其中存储了myApp的类 该应用程序最初使用JSF1.2和Facelets(1.1.15),并部署到Tomcat6,但我现在正在尝试使用JavaEE6和GlassFishV3进行构建 我知道JavaEE6上有JSF2和Facelets,所以我从我的应用程序库中去掉了所有不必要的JAR,留
faces config.xml
只管理bean设置;我的web.xml
包含:
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- Added for facelets -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<sun-web-app error-url="">
<context-root>/MyApp</context-root>
<class-loader delegate="false"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class java code.</description>
</property>
</jsp-config>
</sun-web-app>
编辑
我将浏览器指向http://localhost:9090/myApp/index.jsf
虽然我在服务器日志中看到了这个问题,但问题没有改变
[#|2010-10-15T12:27:17.603+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,603 | INFO | [http-thread-pool-9090-(12)]: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
|#]
[#|2010-10-15T12:27:17.603+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,603 | INFO | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance using parameters: {javax.faces.DEFAULT_SUFFIX=.xhtml, com.sun.faces.validateXml=true, com.sun.faces.forceLoadConfiguration=true, facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE=true, org.richfaces.LoadStyleStrategy=ALL, javax.faces.STATE_SAVING_METHOD=server, org.richfaces.CONTROL_SKINNING=enable, org.richfaces.SKIN=glassX, org.richfaces.CONTROL_SKINNING_CLASSES=enable}
|#]
[#|2010-10-15T12:27:17.603+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,603 | INFO | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance of default capacity
|#]
[#|2010-10-15T12:27:17.635+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,635 | INFO | [http-thread-pool-9090-(12)]: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
|#]
[#|2010-10-15T12:27:17.635+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,635 | INFO | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance using parameters: {javax.faces.DEFAULT_SUFFIX=.xhtml, com.sun.faces.validateXml=true, com.sun.faces.forceLoadConfiguration=true, facelets.RECREATE_VALUE_EXPRESSION_ON_BUILD_BEFORE_RESTORE=true, org.richfaces.LoadStyleStrategy=ALL, javax.faces.STATE_SAVING_METHOD=server, org.richfaces.CONTROL_SKINNING=enable, org.richfaces.SKIN=glassX, org.richfaces.CONTROL_SKINNING_CLASSES=enable}
|#]
[#|2010-10-15T12:27:17.635+0100|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=29;_ThreadName=Thread-1;||STDOUT| 2010-10-15 12:27:17,635 | INFO | [http-thread-pool-9090-(12)]: Creating LRUMap cache instance of default capacity
因此,它看起来像是faces config.xml
内容,但仍然没有呈现。为了确认,我已经在我的web.xml
部署描述符中指定了*.jsf
,我的javax.faces.DEFAULT_后缀
的参数值为.xhtml
,我的欢迎页面和所有其他web内容页面结束.xhtml
服务器两次返回相同的信息有什么意义吗
谢谢你的帮助
编辑2
库中有richfaces-[api | impl-jsf2 | ui]-3.3.Final
jar以及推荐的1.1.15版本的jsf facelets.jar。我的web应用描述符是version=“2.5”
。因为我需要包含Facelets的1.1.15,并且我正在使用GlassFish 3 ie.Java EE 6,所以我尝试将
设置为false,以尝试让我的Facelets 1.1.15 jar被类加载器作为首选项使用,但这并没有任何区别
faces config.xml
设置为version=“2.0”
:
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">