4 Replies Latest reply on Jan 23, 2008 1:02 PM by pmuir

    Still confuse on usage of page param, help please!

    gus888

      Hi,

      I reviewed the seamspace example and tried to understand how and when to use page parameter, but I still get confused. After I commented the following page parameter codes, I couldn't find any performance difference(including bookmarkable page). Anybody can tell me the purpose of using page param and when need to use it. Thank you so much in advance!

      <page view-id="/comment.xhtml" login-required="true">
       <restrict/>
       <!--
       <param name="name" value="#{selectedMember.memberName}"/>
       <param name="blogId" value="#{selectedBlog.blogId}"/>
       -->
       <navigation from-action="#{blog.saveComment}">
       <redirect view-id="/blogentry.xhtml"/>
       </navigation>
       </page>
      and jsp link:
      <s:link view="/comment.seam" value="Add Comment" propagation="none">
       <f:param name="name" value="#{selectedMember.memberName}"/>
       <f:param name="blogId" value="#{selectedBlog.blogId}"/>
       </s:link>


        • 1. Re: Still confuse on usage of page param, help please!
          shane.bryzak

          The page params are actually needed, the reason it was still working when you commented them out is because I'd originally used @RequestParameter params and forgot to remove them. I've fixed up the example in CVS so it should make more sense now.

          • 2. Re: Still confuse on usage of page param, help please!
            gus888

            Thanks, Shane.

            So, based on my understanding on page parameter, when I click on <s:link view="/comment.seam">, the link's f:param will pass "#{selectedMember.memberName}" to "name", and redirect to /comment.xhml page, then page param will get the "name" value and pass it to "#{selectedMember.memberName}" in bean. Is it correct? Thank for any guidance.

            • 3. Re: Still confuse on usage of page param, help please!
              gus888

              Anybody can confirm my understanding on page parameter is correct or not? Thank you.

              So, based on my understanding on page parameter, when I click on <s:link view="/comment.seam">, the link's f:param will pass "#{selectedMember.memberName}" to "name", and redirect to /comment.xhml page, then page param will get the "name" value and pass it to "#{selectedMember.memberName}" in bean. Is it correct? Thank for any guidance.


              • 4. Re: Still confuse on usage of page param, help please!
                pmuir

                No, when the page is renderered, the EL will be evaluated. When the link is clicked, the params are sent as GET parameters, and then correct.