• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how do I use html:link to reference a dynamic file?

 
Toni Heightland
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In my application, a user can generate a file containing search results, which can later be emailed as an attachment. I'm wanting to give the user an option to preview the attachment before sending the email with a "Click here to preview attachment" kind of feature. The name of the file changes depending on the search that the user originally performed. I cannot figure out how to reference the file name.
I've done a lot of searching, but I have not come up with anything.
I've tried:

The attachmentFileName is a property of the form bean associated with this action, as shown below.



I hope this is clear. If not, let me know and I'll give another shot at explaining.
Any help would be greatly appreciated!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to use an EL expression in an <html:xxxx> tag, you must provide the taglib definition for the struts-el version of the tags:

<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>

You must also have the struts-el.jar file in your classpath.

With these things in place, the EL expression should be:

${EmailForm.attachmentFileName}

In this situation, you're not really gaining much by using a Struts tag. You might want to consider using the plain HTML tag:

<a href="${EmailForm.attachmentFileName}">Click here</a>

This assumes you're using JSP 2.0

if not, it would be

<a href="<cut value='${EmailForm.attachmentFileName}' />">Click here</a>
[ April 17, 2006: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic