Prettyfaces mapping problem

Splash Forums PrettyFaces Users Prettyfaces mapping problem

Tagged: 

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

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

    Anglo
    Participant

    Hi
    I’m switching from faces mapping to prettyfaces, it works fine locally on my laptop, but when I upload the project files to a real-life domain (example.com), one part of prettyfaces is not working
    here what I have on my web.xml

    
    <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>/news/*</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>/welcome.html</welcome-file>
        </welcome-file-list>
        <context-param>
            <param-name>primefaces.THEME</param-name>
            <param-value>bootstrap</param-value>
        </context-param>
     
        
        <filter>
            <filter-name>PrimeFaces FileUpload Filter</filter-name>
            <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>PrimeFaces FileUpload Filter</filter-name>
            <servlet-name>Faces Servlet</servlet-name>
            <dispatcher>FORWARD</dispatcher>
            <dispatcher>REQUEST</dispatcher>
        </filter-mapping>
        <filter>
            <filter-name>authorizationFilter</filter-name>
            <filter-class>com.domain.AuthorizationFilter</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>authorizationFilter</filter-name>
            <url-pattern>/app/*</url-pattern>
        </filter-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>
            <dispatcher>ASYNC</dispatcher>
        </filter-mapping>
    
    

    context.xml

    
    <Context 
        antiJARLocking="true" 
        path="/project" 
        allowCasualMultipartParsing="true"
    />
    

    pretty-config.xml

    
     <url-mapping id="app">
            <pattern value="/app/home" /> 
            <view-id value="/news/app/home.xhtml" />        
     </url-mapping>
    
    <url-mapping id="about">
            <pattern value="/about" /> 
            <view-id value="/news/about.xhtml" />
    </url-mapping>
         
            
    <url-mapping id="contact">
            <pattern value="/contact" /> 
            <view-id value="/news/contact.xhtml" />
    </url-mapping>
    
    

    when I access the project locally on my laptop at

    
    http://localhost:8080/project
    

    I’m able to access the paths

    
    http://localhost:8080/project/about
    http://localhost:8080/project/contact
    http://localhost:8080/project/app/home
    

    the only problem I’m facing when I upload the configuration files to the internet domain (mycompany.com) is the following path is not accessible

    
    http://mycompany.com/app/home
    

    while I’m able to access the other paths successfully

    
    http://mycompany.com/about
    http://mycompany.com/contact
    
    

    any help to figure out the problem in the configuration would be appreciated

    • This topic was modified 2 years, 4 months ago by  Anglo.
    • This topic was modified 2 years, 4 months ago by  Anglo.
    #26004

    Which container to you use for development and production? Is it the same (version)?

    The mapping of your FacesServlet is a bit weird. It is mapped to /news/*.

    In the case you may drop the prefix from the view ids. So try this:

    <view-id value="/about.xhtml" />
    

    Instead of:

    <view-id value="/news/about.xhtml" />
    
    #26006

    Anglo
    Participant

    I’m using Prettyfaces version 3.3.3, the wired thing is that when I leave the path value in context.xml to
    path="/project"
    the mapping works fine, but when I remove it
    path=""
    the only mapping paths prefixed with
    /app/*
    won’t work. I have no problem with
    /about and /contact
    they are mapped correctly

    #26007

    Which path values in context.xml do you mean?

    #26031

    Anglo
    Participant

    here is whtat I have in the context.xml

    <Context
    allowCasualMultipartParsing=”true” antiJARLocking=”true” path=”/project”
    />

    • This reply was modified 2 years, 4 months ago by  Anglo.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.