Maven EAR with web module

Splash Forums PrettyFaces Users Maven EAR with web module

This topic contains 1 reply, has 2 voices, and was last updated by  Christian Kaltepoth 6 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17986

    NewOne
    Participant

    My web.xml

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <web-app xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xmlns=”http://java.sun.com/xml/ns/javaee&#8221; xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&#8221;

    xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd

    version=”3.0″>

    <display-name>web</display-name>

    <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>

    <url-pattern>*.jsf</url-pattern>

    </servlet-mapping>

    <filter>

    <filter-name>Pretty Filter</filter-name>

    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>Pretty Filter</filter-name>

    <url-pattern>/*</url-pattern>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    </web-app>

    My pretty-config.xml

    <pretty-config xmlns=”http://ocpsoft.com/prettyfaces/2.0.4&#8243;

    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xsi:schemaLocation=”http://ocpsoft.com/prettyfaces/2.0.4

    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-2.0.4.xsd“>

    <!– Begin Parent Mappings –>

    <url-mapping id=”base”>

    <pattern value=”/hello/#{name}”/>

    <view-id>/index.xhtml</view-id>

    </url-mapping>

    </pretty-config>

    Maven pom for web module

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <project xmlns=”http://maven.apache.org/POM/4.0.0&#8243; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

    xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd“>

    <modelVersion>4.0.0</modelVersion>

    <dependencies>

    <dependency>

    <groupId>javax</groupId>

    <artifactId>javaee-web-api</artifactId>

    <version>6.0</version>

    <scope>provided</scope>

    </dependency>

    <dependency>

    <groupId>javax.faces</groupId>

    <artifactId>jsf-api</artifactId>

    <version>2.0</version>

    <scope>provided</scope>

    </dependency>

    <dependency>

    <groupId>com.ocpsoft</groupId>

    <artifactId>ocpsoft-pretty-faces</artifactId>

    <version>2.0.4</version>

    </dependency>

    </dependencies>

    </project>

    If I deploy the EAR to my Glassfish v3.0.1 OpenSource. It cannot find the PrettyFilter.class

    #21134

    The first thing I’m seeing here is that you are using a very very very old version of PrettyFaces. You should really update to the most recent version. If you are using JSF 2.0 add this dependency:

    <dependency>
    <groupId>com.ocpsoft</groupId>
    <artifactId>prettyfaces-jsf2</artifactId>
    <version>3.3.0</version>
    </dependency>

    If you are deploying to a Servlet 3.0 environment (which is true in your case according to the web.xml) you won’t have to add the PrettyFaces filter to the web.xml at all. PrettyFaces will automatically be configured correctly by the container.

    Hope this helps! :)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

Comments are closed.