my dog learned polymorphism
The moose likes Struts and the fly likes Portlets with Struts File Upload Trouble Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Portlets with Struts File Upload Trouble" Watch "Portlets with Struts File Upload Trouble" New topic

Portlets with Struts File Upload Trouble

tersanch Fernandes

Joined: Jan 28, 2006
Posts: 3
Hey Everyone,

I have a jsp file with a few text fields I generate the text field on the jsp page useing the <html:text> Tag I also have a <html:file>TAG as i need to give users to upload a file on the same jsp page. I use a FormBean which is as below which has the appropriate getter and seter methods and have kept it in session.

public class StockRepairForm extends ValidatorForm implements Serializable {
private String model_Num1 ="";
private String model_Num2 ="";
private FormFile csvFile;

I have set the form to enctype = "multipart/form-data" so that its able to accomodate the <html:file> and the FormBEan is populated.

For some reason I get null values from the FormBean from the action class for the text fields that I have in the jsp. But when i make changes the enctype="multipart/mixed" I do get the formbean values for the text field in the action class. But the <html:file> TAG for some reason is throwing the exception mentined below.

THe exception mentined below disappears when i change the enctype = "multipart/form-data" but when I make this change the text fields are not getting populated and I get empty values in the action class.

Nested Exception is org.apache.jetspeed.portlet.PortletException: BeanUtils.populate
at org.apache.jetspeed.portlet.Portlet._dispatch(

Anyone whos knows absolutly anything on this problem, Please do let me know...I have no clue why the jsp is behaving so indifferently.

Thanks in advance....
Ashish Tahasildar

Joined: Dec 10, 2006
Posts: 12
Are you using <html:file> tag or <html:file name="FormName" property="cvsFile"/> ?

If you are simply using <html:file> please use the property name also.
Reply me

I agree. Here's the link:
subject: Portlets with Struts File Upload Trouble
It's not a secret anymore!