Custom Servlets

Splash Forums PrettyFaces Users Custom Servlets

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

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

    iyemane
    Participant

    Every thing from the JSF works fine, Great Work!

    But when I try to map url from my servlet and filter class using customredirector

    ….

    new CustomRedirector().redirect(request, response,

    “pretty:adminlogin”,null);

    java.lang.NullPointerException

    at com.ocpsoft.pretty.faces.util.PrettyURLBuilder.build(PrettyURLBuilder.java:113)

    Can you point me where is the problem.

    I spent a couple of days on figuring out this….

    mojarra 2.1.1

    eclipse

    prettyfaces 3.2.0

    Thanks!

    #20874

    I just had a quick look at the code and it seems like the NullPointerException is occurring because you supply null for the parameters. Try an empty map or list depending on what build method of PrettyURLBuilder you are calling.

    Another thing I saw: You supply “pretty:adminlogin” for the mapping ID. That is not correct. The prefix pretty: is just used for JSF navigation to identify the action outcome as a PrettyFaces navigation case. The mapping ID is “adminlogin”. So you will have to use this when calling the CustomerRedirector.

    #20875

    iyemane
    Participant

    Thanks Christian,

    That’s true I supplied null… which should be in my case

    Map<String, String[]> param = new TreeMap<String, String[]>();

    String targetURL = builder.build(mapping, false, param);

    that’s it, Awesome!

    #20876

    Nice to hear that its working now.

    In the meantime I added some additional null checks to PrettyURLBuilder so that even supplying null for the parameters should work in the future.

    Christian

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

You must be logged in to reply to this topic.

Comments are closed.