Eclipse/Tomcat 6无法识别Facelets选项卡库

vol*_*vox 1 eclipse jsf facelets myfaces

我把它包含在我的index.jsp JSF文件中:

<%@ taglib prefix="ui" uri="http://java.sun.com/jsf/facelets"%>
Run Code Online (Sandbox Code Playgroud)

和Eclipse强调URL,悬停给出:

Cannot find the tag library descriptor for "http://java.sun.com/jsf/facelets"
Run Code Online (Sandbox Code Playgroud)

部署并尝试使用Tomcat插件启动Tomcat 6会导致:

|STDOUT| 2010-03-03 17:57:29,872 | INFO  | [main]: Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
    |STDOUT| 2010-03-03 17:57:29,904 | INFO  | [main]: ServletContext 'C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\myapp\' initialized.
    |STDOUT| 2010-03-03 17:57:29,904 | INFO  | [main]: Checking for plugins:org.apache.myfaces.FACES_INIT_PLUGINS
    03-Mar-2010 17:57:29 org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    03-Mar-2010 17:57:29 org.apache.catalina.core.StandardContext start
    SEVERE: Context [/myapp] startup failed due to previous errors
Run Code Online (Sandbox Code Playgroud)

...

03-Mar-2010 17:57:30 com.sun.faces.config.ConfigureListener contextDestroyed
SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)
Run Code Online (Sandbox Code Playgroud)

我的web.xml包含这个

<listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
Run Code Online (Sandbox Code Playgroud)

我的face-config.xml包含这个

    <application>
    <!-- tell JSF to use Facelets -->
    <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
Run Code Online (Sandbox Code Playgroud)

我的应用程序构建具有最新的JSF 2.0.2 jsf-api.jar和jsf-impl.jar.我还有MyFaces 1.2.8和所有最新的公共罐子.该应用程序正在建设,直到我升级JSF.我至少会期待运行时错误,但这里的Eclipse无法看到taglib.我还能错过什么?

编辑

有关完整信息 - 我拿出了Mojarra并离开了Myfaces.这意味着我需要从我的中删除它web.xml:

<listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener> 
Run Code Online (Sandbox Code Playgroud)

并用myfaces的等效替换它:

<listener>
  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
Run Code Online (Sandbox Code Playgroud)

谢谢

Boz*_*zho 6

不要将JSF 2.0与JSF pre-2.0混合使用.它可能会导致意想不到的结果(如上所述).

选择一个JSF 2.0实现(看起来像mojarra)并删除所有myfaces和facelets库.