Announcement Announcement Module
Collapse
No announcement yet.
AbstractWizardFormController and Multipart/data Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AbstractWizardFormController and Multipart/data

    Hi,
    I have AbstractWizardFormController with 3 pages.
    first.jsp file_upload.jsp finish.jsp

    There are no problem until file_upload.jsp not contain form with encytype="multipart/form-data".

    If "file_upload" view contain simple form ( not multipart ) evrything work fine ( without file uploading offcourse ) but if we have encytype="multipart..." we can show first.jsp
    and after clik next button server show form2 - file_upload.jsp but if we clik next whether with file path or not in this view we can not go to finish.jsp.

    What is wrong?

    Is there anybody who see tutorial/examples of AbstractWizardFormController with FileUploading techniq. Google can't help with this.

  • #2
    Please help me guys. I know that the problem looks like simple and described in google but I found many post like this
    http://forum.springsource.org/showthread.php?t=36973
    http://forum.springsource.org/showthread.php?t=44887

    without answer. Could anybody tell what is going on?

    Comment


    • #3
      Re: AbstractWizardFormController and Multipart/data

      This may or may not be related to your problem, but I was having a problem using AbstractWizardFormController and multipart/form-data as well. The problem I was having was that my form was getting "reset" midway through my wizard process not allowing the wizard to finish. I looked through the source and tracked my problem down to my inproper usage of the getCommand(HttpServletRequest request) method.

      I was using a call to getCommand(HttpServletRequest request) from my overridden referenceData method. I didn't realize that a new form would be provided and my existing session form cleared when I called this method. I fixed the problem simply by overriding the referenceData method that takes a command as an argument.

      Hope that helps.

      Comment


      • #4
        Answer found

        Fought with this one for some time and eventually RTFM and found this:

        The ability to handle a multipart request (File Upload) is disabled in Spring Portlet MVC Framework by default, so you need to enable that support by defining the portletMultipartResolver bean in your portlet application context file
        http://www.ibm.com/developerworks/we...patil-pt3.html

        Code:
        <bean id="portletMultipartResolver"
        class= "org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver">
        	<property name="maxUploadSize" value="100000" />
        </bean>
        Simple as that - after adding this bean def, my next/prev buttons and everything else started working again with multipart form posts...

        Hope this helps someone

        Comment


        • #5
          Need Portlet Lifecycle Doc.

          Hi ,
          I am new to Spring portlet (Moreover portlet).I am not aware of how the portlet lifecycle works. Can someone please give some document which explains it.
          Like in spring we have different controllers having different set of methods.
          I am not aware of when to use which controller and how the different methods will be called.

          Thanks,
          Ini

          Comment


          • #6
            I dont remeber what exactly was wrong.
            Last time I wrote application similar to this and everything works fine.

            dispather.xml
            Code:
                <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
                    <property name="maxUploadSize" value="100000"/>
                </bean>
            file_upload.jsp
            Code:
            <form method="post" action="<c:url value="/actionj/"/>" enctype="multipart/form-data">
                 <!--  ... -->
                 <input type="hidden" name="_page" value="1"/>
                 <input id="prev_button" type="submit" name="_target0" value="prev"/>
                 <input type="submit" name="_cancel" value="cancel" />
                 <input id="next_button" type="submit" name="_target2" value="next"/>
            </form>

            Comment

            Working...
            X