Query Parameters annotation target can be mutiple.

Splash Forums Rewrite Users Query Parameters annotation target can be mutiple.

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 1 year, 10 months ago.

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

    jvr
    Participant

    Hi,

    I am using pertty faces annotations in my project.
    I have the common parameter using for mutiple url mapping ids.
    Is there any option two define mutiple target versions.

    @Named(“bean”)
    @RequestScoped
    public class LanguageBean {

    @URLQueryParameter()/* can we specify more than one target */
    private String language;

    /* Getters + Setters */
    }

    Because while woriking with the xml file, we can simply specify the query params for multiple mapping ids.

    #26402

    What do you mean with “more than one target”? Do you want to inject the value into multiple beans? I’m not sure if I understood your requirement correctly.

    #26409

    jvr
    Participant

    Is it possible to set the multiple mapping ids to the @URLQueryParameter?

    #26413

    No, that’s not possible.

    Perhaps it would be a good workaround to read the request parameter yourself? You could inject the HttpServletRequest into your LanguageBean and then simple call HttpServletRequest.getParameter("lang") in a @PostConstruct method. But this way you will only be able to READ the query parameter. It won’t be included in outbound URLs. But I guess this is what you want, right?

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

You must be logged in to reply to this topic.

Comments are closed.