IntelliJ Java IDE
The moose likes JSF and the fly likes Link to a file using h:outputLink tag. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Link to a file using h:outputLink tag." Watch "Link to a file using h:outputLink tag." New topic
Author

Link to a file using h:outputLink tag.

Francisco Neto
Greenhorn

Joined: Mar 29, 2007
Posts: 25
Hi all,

I'd like to know if the hutputLink of the JSF can only render to another page. I want to create a link to a file in my directory system and I'd like to create a link for it in a datatable.

Could anyone point me?

Thanks in advance!
XiaoPeng
Greenhorn

Joined: May 25, 2007
Posts: 3
<hutputLink value="#{facesContext.externalContext.request.contextPath}/local_Dir/#{file.name}">
<hutputText value="#{file.name}"/>
</hutputLink>

#{facesContext.externalContext.request.contextPath} will get you to the root directory of your running application.
 
 
subject: Link to a file using h:outputLink tag.
 
Threads others viewed
setting value for ID attribute dynamically for rich:modalpanel (for templating overlay)
Error happen when using <c:if>
How to download tgz file using jsp in browser
response.setContentType("application/download"); not working
Issue with tomahawk's sorting feature with hyperlink contents
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com