2 Replies Latest reply on Mar 5, 2008 7:04 AM by luxspes

    Problem using @RequestParameter

    xtof83

      Hi I decided to use @RequestParameter for one value elementId,


      but then I dont want to have it in my GET request anymore, I want to make it stay in the session...And getting it when I want


      I used :


      @In(scope = ScopeType.SESSION, required = false)
          @Out(scope = ScopeType.SESSION, required = false)
          @RequestParameter
          protected Long elementId;



      but it seems like, elementId need by this way to be every time present in the GET request :/


      Is there a to do what I want ?


      Thx A Lot

        • 1. Re: Problem using @RequestParameter
          damianharvey.damianharvey.gmail.com

          You could put the @RequestParameter in an Event scoped Bean (eg. myFormHandlerBean) that just handles the form submit. Outject the Bean that actually handles the entity (eg. myEntityBean) and then use pages.xml navigation to redirect to a page that display the Bean that handles the entity.


          Cheers,


          Damian.

          • 2. Re: Problem using @RequestParameter

            Hi!
            I am a newbie... and I am only guessing but.. have you tried with:


            @In(value="elementId;" scope = ScopeType.SESSION, required = false)
            protected Long sessionElementId
            
            @Out(scope = ScopeType.SESSION, required = false)
            @RequestParameter
            protected Long elementId;
            
            



            IMO that might outject elementId and the inject it into sessionElementId. (IMO you need to set the value of the annotation because the name of the injected variable does not match the name of the outjected one).. but I am not sure if my understanding of @Out and @In is correct... maybe I am completely wrong...


            Regards,


            LuxSpes