• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Portlets with Struts File Upload Trouble

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 com.ibm.wps.portlets.struts.WpsStrutsPortlet.actionPerformed(WpsStrutsPortlet.java:1280)
at com.ibm.wps.pe.pc.legacy.SPIPortletInterceptorImpl.handleEvents(SPIPortletInterceptorImpl.java:438)
at org.apache.jetspeed.portlet.Portlet._dispatch(Portlet.java:794)


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....
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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

Regards,
Ashish
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic