Error parsing view-id (correct config is not working)

Splash Forums PrettyFaces Users Error parsing view-id (correct config is not working)

This topic contains 4 replies, has 2 voices, and was last updated by  parindam 6 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17881

    Hi Lincoln,

    For some reason it’s not allowing me to post my web.xml and pretty-config.xml

    trying to post it again..

    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

    id=”WebApp_ID” version=”3.0″>

    <display-name>wompower6</display-name>

    <welcome-file-list>

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

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

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

    </welcome-file-list>

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

    <context-param>

    <param-name>javax.faces.PROJECT_STAGE</param-name>

    <param-value>Development</param-value>

    </context-param>

    <servlet>

    <servlet-name>Resource Servlet</servlet-name>

    <servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>

    </servlet>

    <servlet-mapping>

    <servlet-name>Resource Servlet</servlet-name>

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

    </servlet-mapping>

    <filter>

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

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

    <async-supported>true</async-supported>

    </filter>

    <filter-mapping>

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

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

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>ASYNC</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <filter>

    <filter-name>PrimeFaces FileUpload Filter</filter-name>

    <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>

    <init-param>

    <param-name>thresholdSize</param-name>

    <param-value>102400000</param-value>

    </init-param>

    <init-param>

    <param-name>uploadDirectory</param-name>

    <param-value>D:/tmp</param-value>

    </init-param>

    </filter>

    <filter-mapping>

    <filter-name>PrimeFaces FileUpload Filter</filter-name>

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

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ASYNC</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <context-param>

    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

    <param-value>server</param-value>

    </context-param>

    <session-config>

    <session-timeout>3000</session-timeout>

    </session-config>

    <error-page>

    <exception-type>javax.faces.application.ViewExpiredException</exception-type>

    <location>/index.xhtml</location>

    </error-page>

    <listener>

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

    </listener>

    </web-app>

    #20751

    Continue from previous post

    http://ocpsoft.com/support/topic/primefaces-fileupload-and-prettfaces-error/page/2#post-1032

    changing to what you mentioned solved the error notification.

    <view-id value="/faces/brand/buyBrand.xhtml" />

    But my new url (http://localhost:8080/wompower6/brand/11) is not working.. looking into it now. It says, The requested resource () is not available.

    The older url (http://localhost:8080/wompower6/faces/brand/buyBrand.xhtml?brandID=11) is working though..

    #20752

    This sounds like a bug, but just in case, could you please post your new configuration for this mapping in full? Thanks.

    #20758

    parindam
    Participant

    somehow edited web.xml in my previous post, now will try with pretty-config.xml

    pretty-config.xml

    ===================

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

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

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

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

    <!– Begin Example RewriteRules

    // These are custom rewrite-rules, and are probably not necessary for your application.

    <rewrite match=”^/old-url/(w+)/$” substitute=”/new_url/$1/” redirect=”301″ />

    –>

    <url-mapping id=”brand”>

    <pattern value=”/brand/#{ brandID : buyBacking.selectedBrandID }/” />

    <view-id value=”/faces/brand/buyBrand.xhtml” />

    </url-mapping>

    <!– Begin UrlMappings

    // These are examples of URL mappings, and should be customized for your application.

    <url-mapping id=”home”>

    <pattern value=”/” />

    <view-id>/faces/index.jsf</view-id>

    </url-mapping>

    <url-mapping id=”store”>

    <pattern value=”/store/” />

    <view-id>/faces/shop/store.jsf</view-id>

    </url-mapping>

    <url-mapping id=”viewCategory”>

    <pattern value=”/store/#{ cat : bean.category }/” />

    <view-id>/faces/shop/store.jsf</view-id>

    </url-mapping>

    <url-mapping id=”viewItem”>

    <pattern value=”/store/#{ cat : bean.category }/#{ iid : bean.itemId }/” />

    <view-id>/faces/shop/item.jsf</view-id>

    <action>#{bean.loadItem}</action>

    </url-mapping>

    –>

    </pretty-config>

    #20759

    parindam
    Participant

    Hi Lincoln,

    It’s working. “/” was missing from my url http://localhost:8080/wompower6/brand/11

    After I changed it to “http://localhost:8080/wompower6/brand/11/&#8221;, it’s working.. primefaces fileupload is also working together with prettyfaces..

    You have done a wonderful job !! I am new to this field of JSF etc, but in-spite of that I am able to do most of the stuff with ease because of people like you..

    Thank you all much.

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

You must be logged in to reply to this topic.

Comments are closed.