You might want to check out

http://www.onjava.com/pub/a/onjava/2005/07/13/jsfupload.html

I just recently tried file uploading, and it worked fine. The only issue you'll 
come across is with classloading issues.
If you're using tomahawk, then you have to either
1) put the tomahawk.jar in jsf-libs (under tomcatXXX.sar) 
2) put tomhawk.jar in ear and reference it using Class-Path: in the MANIFEST 
file (of EJB jar)
3) put it in WEB-INF/lib and create a separate bean in the web portion (which 
means the code that goes under WEB-INF/classes or WEB-INF/lib).

Main reason is that the EJB code cannot (and probably should not) access the 
org.apache.myfaces.custom.fileupload.UploadedFile unless you specifically make 
it visible.

FYI :

  | <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
  | <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%>
  | <%@ taglib uri="http://myfaces.apache.org/extensions"; prefix="x"%>
  | 
  | <f:view>
  | 
  |     <h:form id="MyForm" enctype="multipart/form-data" >
  |         ...
  |         <x:inputFileUpload id="myFileId"
  |             value="#{myBean.myFile}"
  |             storage="file"
  |             required="true"/>
  |         ...
  |     </h:form>
  | 
  | </f:view>
  | 
  | 
  | import org.apache.myfaces.custom.fileupload.UploadedFile;
  | ...
  | public class MyBean {
  |     private UploadedFile myFile;
  | 
  |     public UploadedFile getMyFile() {
  |         return myFile;
  |     }
  | 
  |     public void setMyFile(UploadedFile myFile) {
  |         this.myFile = myFile;
  |     }
  |     ...
  | }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3936813#3936813

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3936813


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to