7 Replies Latest reply on Feb 13, 2008 7:53 AM by kooudy

    pages.xml & param

    kooudy

      Hello,
      there is snippet of my pages.xml:

      <page view-id="/detail.jsp">
       <param name="name" value="#{form.name}"/>
      
       <navigation from-action="#{search.actionSearch}">
       <redirect view-id="/detail.jsp">
       <param name="name" value="#{form.name}"/>
       </redirect>
       </navigation>
      </page>
      


      Param name is successfully added to URL query but model is not updated when I change name in URL manualy and query server.

      Form is session POJO object. There is setter in form object.
      I use seam 1.1.6.

      Do I need some Filter? Or what I am doing wrong?



        • 1. Re: pages.xml & param
          pmuir

          How do you mean "query server"?

          I would suggest upgrading to Seam 1.2.1.GA as well.

          • 2. Re: pages.xml & param
            kooudy

             

            How do you mean "query server"?


            When I type in a browser:

            http://localhost:8080/appl/detail.seam?name=John

            then I expect form.name to be updated to value John, but isn't (it does work in blog example).



            • 3. Re: pages.xml & param
              kooudy

              I have discovered following:

              1. When I come to page detail.jsp for the first time, param name is included in URL (but I don't need that here :) ).

              2. When param tag isn't as a child of redirect tag, then after invoking search.actionSearch param name isn't included in URL although it is defined in page tag.

              Reference guide:

              Any navigation rule with a redirect to the view id transparently includes the request parameter. The
              value of the parameter is determined by evaluating the value binding at the end of the invoke application
              phase.


              3. Model isn't updated according to param name (GET request with name param).

              Reference guide:


              The param declaration is bidirectional, just like a value binding for a JSF input
              When a non-faces (GET) request for the view id occurs, Seam sets the value of the named request parameter
              onto the model object, after performing appropriate type conversions.


              • 4. Re: pages.xml & param
                kooudy

                I have just discovered that:

                1. redirect filter must be enabled to append parameters to URL

                2. javax.faces.STATE_SAVING_METHOD must be set to client - according to BLOG example (when I tried to set to server , then it stops work)

                It is required to save state on client?

                • 5. Re: pages.xml & param
                  pmuir

                  Please use 1.2.1.

                  1) Yes, if you use faces naviagation

                  2) no.

                  • 6. Re: pages.xml & param
                    kooudy

                    I can't use 1.2.1 unfortunately, because of companys politics.

                    I've tried to switch STATE_SAVING_METHOD to server in seam blog example and it stop works.

                    Scenario:
                    I've tried to find blog according to a string, this results in URL:

                    http://localhost:8082/seam-blog/seam/search.xhtml?conversationId=2&searchPattern=example


                    then i tried to change example to test i URL (I typed test there manually in browser and press enter):

                    http://localhost:8082/seam-blog/seam/search.xhtml?conversationId=2&searchPattern=test


                    but input field doesn't change a results' haven't been found.

                    thanks for previous reply

                    • 7. Re: pages.xml & param
                      kooudy

                      even in seam 1.2.1 switching STATE_SAVING_METHOD to server breaks URLs to be bookmarkable