404 Page cannot be found Error when using Pretty Faces- Urgent help needed

Splash Forums PrettyFaces Users 404 Page cannot be found Error when using Pretty Faces- Urgent help needed

This topic contains 3 replies, has 2 voices, and was last updated by  Lincoln Baxter III 6 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17959

    hithendra
    Participant

    Hi Mods

    I am a newbie to prettyfaces. I configured my webapp to use prettyfaces and initially got the nullpointer exception. I got rid of that error by using latest Mojarra 2.1.1 release. Now my app is up and running, but i am not able to see the pages. I am getting a RESOURCE IS NOT AVAILABLE error when trying to access http://localhost:9999/PrettyFacesTest/First

    I kept a html link and trying to access the FirstPage.xhtml by using below code

    <a href="First">Click here for First Page</a>

    Below is my pretty-config.xml

    <url-mapping id=”First”>

    <pattern value=”/” />

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

    </url-mapping>

    Below is my web.xml

    <web-app id=”WebApp_ID” version=”3.0″

    xmlns=”http://java.sun.com/xml/ns/javaee&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;

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

    <display-name>Pretty Faces Test</display-name>

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

    <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>*.xhtml</url-pattern>

    </servlet-mapping>

    <servlet-mapping>

    <servlet-name>Faces Servlet</servlet-name>

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

    </servlet-mapping>

    <welcome-file-list>

    <welcome-file>index.jsp</welcome-file>

    <welcome-file>index.xhtml</welcome-file>

    </welcome-file-list>

    </web-app>

    #21046

    hithendra
    Participant

    code was converted to a link in my first post.

    This is how i am accessing the page

    <a href="First">Click here for First Page</a>

    #21047

    hithendra
    Participant

    I figured out the issue.

    I gave a wrong pattern value. Below should be there in pretty-config.xml

    <url-mapping id=”First”>

    <pattern value=”/First” />

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

    </url-mapping>

    #21048

    Glad you got this working :)

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

You must be logged in to reply to this topic.

Comments are closed.