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

  • AbstractWizardFormController Navigation/Session Problem

    I've written a controller that extends AbstractWizardFormController and I can't get the navigation to work properly. The first page is shown, but when I hit submit to go to the second page, the first page just get re-rendered and formBackingObject gets called again, as though it were a new form. Could someone offer me a hand?

    Bean Config:
    Code:
      <bean id="addListingForm" class="com.xxx.bizDir.controller.AddListingForm">
        <constructor-arg index="0"><ref bean="myBizDir"/></constructor-arg>
        <property name="pages">
        	<list>
        		<value>add-listing-select</value>
        		<value>add-listing-info</value>
        		<value>add-listing-contact</value>
        		<value>add-listing-confirm</value>
        	</list>
        </property>
        <property name="sessionForm"><value>true</value></property>
        <property name="commandName"><value>model</value></property>
        <property name="commandClass"><value>com.xxx.bizDir.model.Listing</value></property>
      </bean>
    Page 1 JSP:
    Code:
    <input type="submit" name="_target1" value="Next >" />
    For the controller, I have overriden the following: formBackingObject, validatePage, referenceData, and processFinish.

  • #2
    It looks like you have things setup properly, except possibly the form's request type. The request type is usually of type POST or GET. You should explicitly set the request type on your form to POST (method="POST"). If your from is not POST, the isFormSubmission() method in the AbstractFromController will return true indicating the controller sequence is starting and a new formBackingObject is needed.

    Comment


    • #3
      I've edited this post to remove the full JSP copy, as it is correctly using <form method="post"> and this issue is centered around a session problem as mentioned in my post below...

      Comment


      • #4
        More Information

        OK, using the debugger, I have found out that handleInvalidSubmit(HttpServletRequest request, HttpServletResponse response) is getting on every request.

        I dug deeper and found that AbstractFormController.handleRequestInternal is calling this method because their is no session created for the form (the line HttpSession session = request.getSession(false); returns null). So my problem is a session is not being created for the user. Any idea why no session is being created?


        I'm using Tomcat 5.5.4, JDK 1.5.0, and Spring 1.1.3

        Comment


        • #5
          Problem Resolved

          OK, to continue my dialog with myself...

          I have figured out what the problem is: ZoneAlarm firewall on my development box was preventing the proper writing of session cookies to the browser. Hence, Tomcat kept trying to start a session on every request. I killed ZoneAlarm and the workflow is working properly. :roll:

          This silent failure concerns me. I think I will look to implement some logic that tests for this type of failure. If anyone has done this before and wants to share their technique/code or has insight Tomcat session handling , I would greatly appreciate the time it would save me...

          Comment

          Working...
          X