5 Replies Latest reply on Jan 24, 2007 2:02 PM by Gavin King

    s:link

    jk;l jkl; Expert

      Does s:link always output a lot of text as its rendered HTML? Is there any way to get rid of this to result in more "friendly" URLs? (e.g. put that stuff in hidden form fields or something)

      I noticed the outputted URL has lots of parameters like actionMethod, dataModelSelection...out of curiosity, what do having these parameters do?

        • 1. Re: s:link
          Gavin King Master

          No, you can't put this stuff in form fields, because there is no form! s:link if for GET requests. These parameters only appear when they are needed. In simple cases, they aren't there at all.

          • 2. Re: s:link
            jk;l jkl; Expert

            When would you use s:link vs h:commandButton within a dataTable?

            • 3. Re: s:link
              alberto Gori Novice

               

              "gavin.king@jboss.com" wrote:
              No, you can't put this stuff in form fields, because there is no form! s:link if for GET requests. These parameters only appear when they are needed. In simple cases, they aren't there at all.


              What do you think about using alias names instead of action method encoded in the URL?

              <s:link alias="item">Select Item</s:link>

              and in some action-association.xml

              #{item.selectItem}


              or much better a new annotation.

              This is also an improvement abuot security (you are not exposing the action method name to the client, but I am not sure what seam actualliy is exposing so I could be wrong).

              I did a link component + JSF phase-listener to make work this idea some time ago. The result is that you get prettier URL and maybe good security, but you still have to config the association between alias and action in some XML (but Seam could use an annotation).

              • 4. Re: s:link
                alberto Gori Novice

                 

                "agori" wrote:


                and in some action-association.xml

                #{item.selectItem}



                Sorry, I meant

                <associations>
                
                <alias name="item">
                #{itemBean.selectItem}
                </alias>
                
                </associations>


                • 5. Re: s:link
                  Gavin King Master

                   

                  What do you think about using alias names instead of action method encoded in the URL?


                  You can already do this. Its called a page action.