迁移JSF版本错误

时间:2015-07-27 11:49:50

标签: jsf jsf-2 facelets jsf-1.2

我尝试从JSF 1.2迁移到JSF 2.0。

我有点问题。当我启动Tomcat服务器时,它返回了下一个错误:

" java.lang.ClassNotFoundException:com.sun.facelets.FaceletViewHandle"

我已经读过这个错误,我在web.xml中更改了一些行,但问题并没有消失。

这是我的完整web.xml:

<?xml version="1.0" encoding="UTF-8"?>
   <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>grp2</display-name>

<welcome-file-list>
   <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<context-param>
  <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
  <param-value>resources.application</param-value>
</context-param>

<context-param>
  <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  <param-value>client</param-value>
</context-param>

<context-param>
  <description>
     This parameter tells MyFaces if javascript code should be allowed in
     the rendered HTML output.
     If javascript is allowed, command_link anchors will have javascript   code
     that submits the corresponding form.
     If javascript is not allowed, the state saving info and nested   parameters
    will be added as url parameters.
    Default is 'true'
   </description>
   <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
   <param-value>true</param-value>
</context-param>

<context-param>
  <description>
    If true, rendered HTML code will be formatted, so that it is 'human-readable'
    i.e. additional line separators and whitespace will be written, that do not
    influence the HTML code.
    Default is 'true'</description>
  <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
  <param-value>true</param-value>
</context-param>

<context-param>
  <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
  <param-value>false</param-value>
</context-param>

<context-param>
  <description>
     If true, a javascript function will be rendered that is able to restore the
     former vertical scroll on every request. Convenient feature if you have pages
     with long lists and you do not want the browser page to always jump to the top
     if you trigger a link or button action that stays on the same page.
     Default is 'false'
 </description>
 <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
 <param-value>true</param-value>
</context-param>

<context-param>
  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
  <param-value>.xhtml</param-value>
</context-param>

<context-param>
  <param-name>com.sun.faces.verifyObjects</param-name>
  <param-value>true</param-value>
</context-param>

<context-param>
  <param-name>com.sun.faces.validateXml</param-name>
  <param-value>true</param-value>
</context-param>

<context-param>
  <description>
        If true, a javascript function will be rendered that is able
        to restore the former vertical scroll on every request.
        Convenient feature if you have pages with long lists and you
        do not want the browser page to always jump to the top if
        you trigger a link or button action that stays on the same
        page. Default: &quot;false&quot;
     </description>
   <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
   <param-value>false</param-value>
</context-param>

<context-param>
  <param-name>descargas.ficheros.dir</param-name>
  <param-value>I:/RECURSOS/biblos/ficheros</param-value>
</context-param>

<context-param>
  <param-name>resource.properties.name</param-name>
  <param-value>resources.properties</param-value>
</context-param>

<context-param>
  <param-name>fichero.pdf.dir</param-name>
  <param-value>I:/RECURSOS/biblos/ficheros</param-value>
</context-param>

<filter>
  <filter-name>LoginFilter</filter-name>
  <filter-class>
        com.tratecnica.sep.grp.web.filter.LoginFilter
  </filter-class>

  <init-param>
    <param-name>login_page</param-name>
    <param-value>/index.jsp</param-value>
  </init-param>
</filter>

<filter-mapping>
  <filter-name>LoginFilter</filter-name>
  <url-pattern>/grp/*</url-pattern>
</filter-mapping>

<filter-mapping>
  <filter-name>LoginFilter</filter-name>
  <url-pattern>/file/*</url-pattern>
</filter-mapping>

<servlet>
  <servlet-name>LogInitiator</servlet-name>
  <servlet-class>com.tratecnica.sep.webextensions.servlet.LogInitiator</servlet-class>
  <init-param>
    <param-name>log4j.config.file</param-name>
    <param-value>WEB-INF/classes/grp.log4j.xml</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

<servlet>
  <servlet-name>fileServlet</servlet-name>
  <servlet-  class>com.tratecnica.sep.grp.file.servlet.DownloadFileServlet</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>fileServlet</servlet-name>
  <url-pattern>/file/*</url-pattern>
</servlet-mapping>

<servlet>
  <servlet-name>pdfViewerServlet</servlet-name>
  <servlet-class>com.tratecnica.sep.grp.file.servlet.PdfViewerServlet</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>pdfViewerServlet</servlet-name>
  <url-pattern>/filePDF/*</url-pattern>
</servlet-mapping>

<servlet>
  <servlet-name>GuiServlet</servlet-name>
  <servlet-class>
        com.tratecnica.sep.grp.web.servlet.GuiServlet
    </servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>GuiServlet</servlet-name>
  <url-pattern>/servlet/GuiServlet</url-pattern>
</servlet-mapping>

<error-page>
  <exception-type>java.lang.Exception</exception-type>
  <location>/grp/error.faces</location>
</error-page>

<error-page>
 <exception-type>
        com.tratecnica.sep.grp.web.ControllerException
 </exception-type>
 <location>/grp/error.faces</location>
</error-page>

<error-page>
  <exception-type>
        com.tratecnica.sep.grp.data.exception.DataException
  </exception-type>
  <location>/grp/error.faces</location>
</error-page>

<error-page>
   <exception-type>
        com.tratecnica.sep.crypto.exception.CryptoException
   </exception-type>
   <location>/grp/error.faces</location>
</error-page>

<error-page>
  <exception-type>javax.servlet.ServletException</exception-type>
  <location>/grp/error.faces</location>
</error-page>
<listener>
  <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

<servlet>
  <servlet-name>Faces Servlet</servlet-name>
  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>/faces/*</url-pattern>
</servlet-mapping>

我一直只使用JSF版本。我从未改变过JSF版本。我不知道错误在哪里。

我需要你的帮助。

谢谢大家。

0 个答案:

没有答案