File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes file uploading problem PLZ HELP ME OUT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "file uploading problem PLZ HELP ME OUT" Watch "file uploading problem PLZ HELP ME OUT" New topic

file uploading problem PLZ HELP ME OUT

java freak

Joined: Mar 09, 2005
Posts: 7
i am having 3 jsp pages and for alll 3 jsps only one form BEAN
and in my first JSP i am having the file upload
i am able to upload the file into DATABASE successfully also
but my problem comes next
after uploading when i click tab to goto next jsp
the next JSP alo displayed properly
but from there onwards when i clik on any button on any tab for moving to other JPSs
i am getting the following eroor

java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(
at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(
at org.apache.commons.beanutils.PropertyUtils.setProperty(
at org.apache.commons.beanutils.BeanUtils.setProperty(
at org.apache.commons.beanutils.BeanUtils.populate(
at org.apache.struts.util.RequestUtils.populate(
at org.apache.struts.action.RequestProcessor.processPopulate(
at org.apache.struts.action.RequestProcessor.process(
at org.apache.struts.action.ActionServlet.process(
at org.apache.struts.action.ActionServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at weblogic.servlet.internal.ServletStubImpl$
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.WebAppServletContext$
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(
at weblogic.servlet.internal.ServletRequestImpl.execute(
at weblogic.kernel.ExecuteThread.execute(

and i tried all most all the possibilities
i declared the following thing in all the 3 jsps

<html:form action="/esmtLevel" enctype="multipart/form-data" styleId="estimateLevel012Form" >

my getter and setter methods are

public FormFile getPartImage() {
return partImage;

public void setPartImage(FormFile partImage) {
this.partImage = partImage;

and i declared bean field as FORMFILE element only

form past 2 days i was having problem vth this one
and any help would be appereciated[
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try using the ActionForm bean with the FormFile attribute only with the JSP that actually performs a file upload. Use an ActionForm that does not contain this attribute for the other JSPs.

Consultant, Sima Solutions
java freak

Joined: Mar 09, 2005
Posts: 7
i can't wirte three different forms
why because i am moving back and fourth very frequently and when i move like this i need to keep up the values alive when i move back and fourth
i.e when user comes to that screen once again he has to get the values what ever he selected in the begning
It is sorta covered in the JavaRanch Style Guide.
subject: file uploading problem PLZ HELP ME OUT
It's not a secret anymore!