• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
Not so fast naughty spawn! I want you to know about
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic