[solved] Prettyfaces in GAE environment

Splash Forums PrettyFaces Users [solved] Prettyfaces in GAE environment

This topic contains 14 replies, has 2 voices, and was last updated by  edgar 7 years, 1 month ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #17765

    edgar
    Participant

    Hi,

    I am trying to use prettyfaces into a GAE environment, I configured my web.xml like this:

    http://github.com/edgars/corerest/blob/master/corerest/war/WEB-INF/web.xml

    Here is my pretty-faces config:

    http://github.com/edgars/corerest/blob/master/corerest/war/WEB-INF/pretty-config.xml

    If I try call http://<server&gt;:8888/app/ it never calls index.faces

    Any comments on that?

    Cheers

    Edgar

    #20057

    Hey Edgar,

    There may be a few things wrong. Based on your current config, I’d expect you to get a 404 error when you try to access “/”.

    First, remove the rewrite rules from the pretty-config… they will likely break your unmapped pages since they are just examples. (They need to be removed from the docs.)

    Second, your url-mapping needs to match your Faces-Servlet mapping:

    <url-mapping id="home">
    <pattern value="/" />
    <view-id>/index.faces</view-id>
    </url-mapping>

    Notice the ‘/’ in front of index.faces (the path must begin at the context). If that still doesn’t work, I’ll need to see

    Let me know if this helps.

    –Lincoln

    #20058

    edgar
    Participant

    Yep Lincoln, it is a NOT FOUND error that I am getting, let me try this

    #20059

    Also, your website homepage is: http://corerest.appspot.com/home.faces, but you used /index.faces… is that relevant?

    #20060

    edgar
    Participant

    I got this error :

    HTTP ERROR 404

    Problem accessing /app. Reason:

    NOT_FOUND

    Powered by Jetty://

    #20061

    edgar
    Participant

    I am still getting HTTP ERROR 404

    #20062

    edgar
    Participant

    I changed as you recommended, still getting error!

    #20063

    Very strange. Are you sure that you are sending the request to the right view-id? does /index.faces exist?

    The 404 message does not look very descriptive. Also, is it possible that you have to do something special in order for GAE to even invoke a filter if there is no Servlet or file “mapped” to the requested URL?

    Sometimes you have to enable that behavior, like on websphere: http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html_single/#d0e1334

    #20064

    I suppose I should ask, did this work on a non GAE server?

    #20065

    edgar
    Participant

    Lincoln,

    The http://corerest.appspot.com/home.faces is the version under production, I am working on a new version that runs locally in my machine.

    #20066

    edgar
    Participant

    This is the error log:

    Aug 16, 2010 7:43:27 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet

    WARNING: No file found for: /app/

    Any idea?

    I have the prettyfaces starting apparently fine:

    INFO: Successfully processed /opt/work/gitprojects/corerest/corerest/war/WEB-INF/web.xml

    1107 [main] INFO com.ocpsoft.pretty.PrettyFilter – PrettyFilter starting up…

    2660 [main] INFO com.ocpsoft.pretty.PrettyFilter – PrettyFilter initialized.

    Aug 16, 2010 7:18:37 PM com.google.appengine.tools.development.DevAppServerImpl start

    #20067

    Can you tell if PrettyFilter is being invoked? Can you turn com.ocpsoft=DEBUG logging on? (Log4J) Or can you actually debug the app and see if the filter is triggering?

    I have a sneaking suspicion that the request is never being passed on to the webapp because GAE thinks there’s nothing there.

    #20068

    edgar
    Participant

    Lincoln,

    As a matter of fact this is pretty easy, seems that PrettyFilter is ready to work just if we use the mapping configured to : “/*”, as the follow:

    <filter-mapping>

    <filter-name>PrettyFilter</filter-name>

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

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    Once I put that, everything is working fine!

    Thanks for you support, and soon you will see a cool app using prettyfaces running on Google AppEngine.

    cheers

    Edgar

    #20069

    Isn’t that what you had in your original web.xml? What happened to it? :p I call shenanigans!

    <filter-mapping>
    <filter-name>PrettyFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    #20070

    edgar
    Participant

    Nop, I had:

    <filter-mapping>

    <filter-name>PrettyFilter</filter-name>

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

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    And that’s my mistake, there’s no resource for *app* initially speaking :D

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

You must be logged in to reply to this topic.

Comments are closed.