Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Download file via link in JSF

843844Mar 3 2010 — edited Mar 5 2010
Hi!

I would the user to download the zip file from a link
so i wrote the following code:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<html>
<body>
<f:view>
	<rich:panel header="Welcome">
		
		<h:outputLink value="#{myBean.value}">Click here to try through output link</h:outputLink>
		<br><a href="C:\\inserts.zip">click here to try fom a hre</a> 
		
	</rich:panel>
</f:view>
</body>
</html>
But it doesn't work for both cases!
The browser says as error: Not allowed to load local resource: file:///C://inserts.zip
When i open it with as an HTML with no JSF/RichFaces -
It downloads it perfectly!
What is the problem?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 2 2010
Added on Mar 3 2010
1 comment
581 views