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 7 years, 3 months ago.

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



    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.

    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.


    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.



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


    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)

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.