Parameter Injection Problem

Splash Forums PrettyFaces Users Parameter Injection Problem

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #17874

    paulcartmell
    Participant

    Hi there

    I’ve been using PrettyFaces for a while now and have experienced a problem when I upgraded from version 3.0.1 to 3.2.0.

    Previously I had an entry in the pretty-config.xml of:

    <url-mapping id=”category-info”>

    <pattern>/category/#{pageManager.categoryURL}</pattern>

    <view-id>#{pageManager.getCategoryPage}</view-id>

    </url-mapping>

    This has worked fine from earlier versions but has stopped injecting the category URL when I have changed to the new version.

    Is there something incorrect with what I am trying to do with the above configuration?

    Any guidance will be gratefully received!

    Thanks

    Paul.

    #20708

    Hey Paul,

    your configuration looks good. Could you post the code of your PageManager class? What exactly is the error? Is categoryURL null when getCategoryPage is called or do you get a 404?

    You could also try version 3.1.0 and tell us if the error is happening there too.

    #20709

    paulcartmell
    Participant

    Hi Christian

    The relevant code from the PageManager class looks like this:

    /**

    *

    */

    public class PageManagerBean

    {

    /**

    *

    */

    @EJB

    protected SiteManagerBean siteManagerBean;

    /**

    *

    */

    protected String categoryURL;

    /**

    *

    */

    public String getCategoryPage()

    {

    // Call to site manager to return page based on URL

    return siteManagerBean.getPage(PageType.CATEGORY_PAGE, categoryURL);

    }

    /**

    *

    */

    public void setCateogryURL(String categoryURL)

    {

    this.categoryURL= categoryURL;

    }

    }

    The actual error is a null pointer from the call to the SiteManagerBean; categoryURL is null at the time the getCategoryPage() method is called.

    The setCategoryURL method is never called (I put a logger call in to check) and then I get a 404 because of the error.

    I have tried version 3.1.0 and get the same error; switching back to 3.0.1 immediately fixes the problem.

    Thanks

    Paul.

    #20710

    paulcartmell
    Participant

    Some more information I should have mentioned:

    I’m running this on Glassfish 2.1 using JSF 1.2.

    I’m currently in the process of upgrading to GF3 and JSF2 but haven’t managed to test this problem in that environment.

    Thanks

    Paul.

    #20711

    Hmmm.. Seems like a problem that was introduced in PrettyFaces 3.1.0 then!

    Could you create an issue for this?

    http://code.google.com/p/prettyfaces/issues/list

    #20712

    paulcartmell
    Participant

    Will do; do you need any additional information other than the above?

    Thanks

    Paul.

    #20713

    The best case would be a minimal sample application that reproduces this. You could use the PrettyFaces Maven archetypes to setup something very quickly:

    https://github.com/chkal/prettyfaces-archetypes/wiki

    #20714

    paulcartmell
    Participant

    Hi Christian

    I started putting together a sample to reproduce the problem and I couldn’t – it worked fine.

    I then checked my application and it also worked fine!

    Nothing has changed (honestly!) however it now performs as expected.

    I will investigate further and see if I can figure out what has occurred.

    I will post here should I find what caused the problem.

    Thanks

    Paul.

    #20715

    Hey Paul,

    thank you for the update. That’s a very strange issue you are seeing. If you find any clue why this happened it would be great if you let us know..

    Christian

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

You must be logged in to reply to this topic.

Comments are closed.