title: How to download file from inside Seam PDF
body: <p>In out project we are creating a pdf by using seam pdf and storing that pdf in the database.</p>
  
  <p>The user can then search up the pdf and view it in their pdf viewer. This is a small portion of the code that is generated to pdf:</p>
  
  <pre><code>&lt;p:html&gt;
  &lt;a:repeat var="file" value="#{attachment.files}" rowKeyVar="row"&gt;
  &lt;s:link action="#{fileHandler.downloadById()}" value="#{file.name}" &gt;
      &lt;f:param  name="fileId" value="#{file.id}"/&gt;
  &lt;/s:link&gt;
  &lt;/a:repeat&gt;
  </code></pre>
  
  <p>When the pdf is rendered, a link is generated that points to:</p>
  
  <pre>
  /project/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById()&cid=16</pre>
  
  <p>As you can see this link doesnt say much, and the servletpath seems to be missing.</p>
  
  <p>If I change /project with the servletpath</p>
  
  <pre>localhost:8080/saksapp/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById%28%29&cid=16</pre>
  
  <p>Than the download file dialog appears. So my question is, does anyone know how I can input the correct link? And why this s:link doesnt seem to work?</p>
  
  <p>If I cannot do that, then I will need to somehow do search replace and edit the pdf, but that seems like a bit of a hack.</p>
  
  <p>(This is running under JBoss)</p>
  
  <p>Thank you for your time....</p>