2010-11-30 146 views
2

我目前使用JSF 1.1的Apache Tomcat 6.0.13,与行家 2.JSF 1.1〜1.2的迁移

我刨迁移从JSF 1.1〜1.2。可能有人点我在: - 什么JSF实现最好用 - 可在Maven的中央资料库 此实现 - 我需要什么样的代码部分调整(我使用自定义标签在我的项目,但除此之外,这是所有普通JSF)

任何信息将是有益的...感谢名单!

[编辑1]:

嗯,它并没有为我工作。无法从您指定的存储库下载依赖项。也许这是因为这是链接maven 1存储库。我正在使用以下pom设置:

 <dependency> 
      <groupId>javax.faces</groupId> 
      <artifactId>jsf-api</artifactId> 
      <version>1.2</version> 
      <type>jar</type> 
      <scope>system</scope> 
      <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/jsf-api.jar</systemPath> 
     </dependency> 
     <dependency> 
      <groupId>javax.faces</groupId> 
      <artifactId>jsf-impl</artifactId> 
      <version>1.2</version> 
      <type>jar</type> 
      <scope>system</scope> 
      <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/jsf-impl.jar</systemPath> 
     </dependency> 

我希望这种方法是正确的。如果有人有一个更友善的解决方案,请告知。感谢名单!

[编辑2]: 我从1.1版更改了我的JSF jar之后。 1.2,在应用程序启动时发生以下错误:

java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: 
javax.faces.context.FacesContextFactory 

要修正这个错误,另外听众需要在web.xml中添加:

<listener> 
     <listener-class>com.sun.faces.config.ConfigureListener</listener-class> 
    </listener> 

回答

3

看一看拥有下列发行说明从1.1迁移引导至1.2 http://java.sun.com/javaee/javaserverfaces/docs/ReleaseNotes.html

为JSF 1.2中的maven2工件发现他们的方式在位于http://http://repo1.maven.org/maven2

标准maven2的存储库

JSF实现

http://repo2.maven.org/maven2/javax/faces/jsf-impl/1.2-b19/

JSF API

http://repo1.maven.org/maven2/javax/faces/jsf-api/1.2-b19/

这样,你不应该要求你的pom.xml或settings.xml的任何特殊设置库

依赖c一个可以在POM这样定义(1.2-B19是在写作时的最新版本):

<dependency> 
     <groupId>javax.faces</groupId> 
     <artifactId>jsf-api</artifactId> 
     <version>1.2-b19</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.faces</groupId> 
     <artifactId>jsf-impl</artifactId> 
     <version>1.2-b19</version> 
    </dependency> 

包括以下是应包含的基本依赖用于启动JSF项目1.2的完整的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.ecs.sample.jsf</groupId> 
    <artifactId>SampleJsfPom</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>war</packaging> 
    <build> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <source>1.5</source> 
        <target>1.5</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
    <dependencies> 
     <dependency> 
      <groupId>javax.faces</groupId> 
      <artifactId>jsf-api</artifactId> 
      <version>1.2-b19</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.faces</groupId> 
      <artifactId>jsf-impl</artifactId> 
      <version>1.2-b19</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.facelets</groupId> 
      <artifactId>jsf-facelets</artifactId> 
      <version>1.1.11</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-digester</groupId> 
      <artifactId>commons-digester</artifactId> 
      <version>1.7</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-beanutils</groupId> 
      <artifactId>commons-beanutils</artifactId> 
      <version>1.7.0</version> 
     </dependency> 
     <dependency> 
      <groupId>commons-collections</groupId> 
      <artifactId>commons-collections</artifactId> 
      <version>3.2</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>jstl</artifactId> 
      <version>1.1.0</version> 
     </dependency> 
     <dependency> 
      <groupId>javax.servlet</groupId> 
      <artifactId>servlet-api</artifactId> 
       <version>2.5</version> 
      <scope>provided</scope> 
     </dependency> 
    </dependencies> 
</project> 
+0

Thanx,这只是我一直在寻找的信息。 – Igor 2010-11-30 12:42:49