[jboss-user] [JBoss Seam] - s:fileUpload problem

Zerg-Spirit do-not-reply at jboss.com
Mon Jul 2 10:04:54 EDT 2007


Hello.

I'm having a problem using the s:fileUpload component, or more exactly the backing bean related to it, since I updated my application to the 1.3 (and later 2.0) version of Seam.


JSF:
<h:form enctype="multipart/form-data">
  | 					
  | 					<s:fileUpload id="data" data="#{uploadFile.data}" accept="*"
  | 						contentType="#{uploadFile.dataContentType}" />
  | 					<h:commandButton value="Upload" action="#{uploadFile.processData}"
  | 						styleClass="registerButton" />
  | 				</h:form>

Basically, the 'processData' method is loaded after a lot of time when I push the button, like several seconds (if not minutes) after.

Backing bean:

  | @Name("uploadFile")
  | public class UploadFile implements iUploadFile{
  | 
  | 	private byte[] data;
  | 	
  | 	private String dataContentType;
  | 	public void processData() {
  | 		//my code to process the 'data' here.
  | 	}
  | 
  | 	/**
  | 	 * @return the data
  | 	 */
  | 	@Lob
  | 	public byte[] getData() {
  | 		return data;
  | 	}	
  | 
  | 	/**
  | 	 * @param data
  | 	 *            the data to set
  | 	 */
  | 	@Lob
  | 	public void setData(byte[] data) {
  | 		this.data = data;
  | 	}
  | 
  | 	/**
  | 	 * @return the dataContentType
  | 	 */
  | 	public String getDataContentType() {
  | 		return dataContentType;
  | 	}
  | 
  | 	/**
  | 	 * @param dataContentType
  | 	 *            the dataContentType to set
  | 	 */
  | 	public void setDataContentType(String dataContentType) {
  | 		this.dataContentType = dataContentType;
  | 	}
  | 	
  | }

I added the @Lob annotation reading the seam doc, but I didn't have it before.
Basically, the processData isn't called right after a click on the button, but after a huge delay, meanwhile I have a 'backing work' cursor, so the server still hasn't replied.


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

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



More information about the jboss-user mailing list