Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 613515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:00:41+00:00 2026-05-13T18:00:41+00:00

In out project we are creating a pdf by using seam pdf and storing

  • 0

In out project we are creating a pdf by using seam pdf and storing that pdf in the database.

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:html>
<a:repeat var="file" value="#{attachment.files}" rowKeyVar="row">
<s:link action="#{fileHandler.downloadById()}" value="#{file.name}" >
    <f:param  name="fileId" value="#{file.id}"/>
</s:link>
</a:repeat>

When the pdf is rendered, a link is generated that points to:

/project/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById()&cid=16

As you can see this link doesnt say much, and the servletpath seems to be missing.

If I change /project with the servletpath

localhost:8080/saksapp/skjenkebevilling/status/status_pdf.seam?fileId=42&actionMethod=skjenkebevilling%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById%28%29&cid=16

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?

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.

(This is running under JBoss)

Thank you for your time….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:00:42+00:00Added an answer on May 13, 2026 at 6:00 pm

    I found a workaround for this problem.
    Seems I have to use s:link together with a normal a href tag.
    Only having href tag doesn’t work for some reason.

    <s:link action="#{fileHandler.downloadById()}" value="#{file.name}" propagation="none">
        <f:param name="fileId" value="#{file.id}"/>
    </s:link>
    <a href="#{servletPath.path}?fileId=#{file.id}&amp;actionMethod=#{path.replace('/','')}%2Fstatus%2Fstatus_pdf.xhtml%3AfileHandler.downloadById()&amp;">
        download
    </a>
    

    The servletPath.path returns the servlet path ie http://mydomain.com/download.seam
    You can decide to put login-required=true on the download.seam if you want users to login before downloading a file.

    @Observer("org.jboss.seam.security.loginSuccessful")
    public void servletPath() {
    HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
        this.path = request.getRequestURL().toString().replace("login.seam", "download.seam");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im using netbeans with svn. i've checked out a project and then i used
I'm creating a few gems by extracting out parts of a Rails project that
Is there a jQuery project out there, that create on of these Password-strength-meters right
So I am starting out on company project that will have several components: At
I'm creating a project under eclipse that is to be shared by several developers.
I'm creating a Django project. I just tried taking the project out of debug,
I'm working on a project that involves creating a spline from a defined set
I'm attempting to learn Ruby on Rails by creating a project and I can't
I copied the ApiDemos sample to my workspace, then tried creating a new project
How can I find out from many class file that the particular file is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.