1 Reply Latest reply on Dec 1, 2009 6:29 PM by Emir Calabuch

    s:download vs s:link...

    cyril vidal Newbie

      Dear all,


      Can anyone explain me the real interest of using component s:download vs s:link?


      1°) It seems to be rendered as a html a href
      2°) no f:actionListener binding... is working inside (f:actionListener is never called in a GET request right?)


      Thanks in advance for your type...
      C.


        • 1. Re: s:download vs s:link...
          Emir Calabuch Newbie

          s:link serves to render a link to another JSF page, but using GET instead of POST (and therefore is an alternative to h:commandLink or a:commandLink, not to s:download).


          s:download, on the other hand, renders a link to a resource served via the DocumentStoreServlet facility shipped with Seam (which is a way of exposing non-JSF resources, such as images or other content, without having to write a separate servlet). This tag allows you to serve non-static content with ease (otherwise you would need to create a custom servlet to provide the content).


          s:download is not the only tag that uses the document store. s:graphicImage also uses the document store (it first places the image in the document store and then renders an img tag with the url of the document store in it), as do several other Seam tags.