• 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

Bean setters not called after forward, if enctype multipart/form-data is used in JSP

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

we have a strange problem using the enctype="multipart/form-data" in a html:form within a JSP (in order to upload a file).

The jsp maske.jsp contains:
<html:form action="firstAction.do" enctype="multipart/form-data" method="POST">

After the post, the "firstAction" action is called. The reset() method of the "myFormBean" form bean is called and the bean is filled by calling its setter-methods.
Now the executeAction() method in class ExecuteAction.java will be entered, the form is filled and everything is ok.
The executeAction() will be left with the forward "mail", which leads into the "secondAction.do".

Without the JSP's enctype="multipart/form-data", the reset() method of the bean is called, afterwards the setters to refill the bean and then the executeAction() of class SecondAction.java is called. In this case everything is ok.
The problem: With use of the enctype="multipart/form-data" in the JSP, only the reset() method is called, but not the bean's setters. Consequently the formfields of the bean are not set.

We are thankful for all kinds of hints and advices.

The relevant part in the struts-config.xml is as follows:

<action path="/firstAction" input="inputmask.jsp" name="myFormBean" type="de.axa.axawebforms.actions.ExecuteAction" scope="session">
<forward name="mail" path="/secondAction.do"/>
</action>

<action path="/secondAction" name="myFormBean" type="de.axa.axawebforms.actions.SecondAction" scope="session">
<forward name="stay" path="/inputmask.jsp"/>
<forward name="success" path="/inputmask.jsp"/>
</action>


Thanks a lot!
Regards,
Sanjay Jena
reply
    Bookmark Topic Watch Topic
  • New Topic