Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Link to a file using h:outputLink tag.  RSS feed

 
Francisco Neto
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!