Announcement Announcement Module
Collapse
No announcement yet.
spring portlet - SimpleFormController Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring portlet - SimpleFormController

    Hi,
    We are moving from Spring MVC to Spring portlet the application. I have 2 classes, one implements Controller and other extends SimpleFormController. We use Two controllers acting as handlers. One to be used when a Form based Page is submitted and the other when non-form based page is submitted. The controllers worked fine when using the Spring MVC. But on to Spring Portlet, when a form-based page is submitted, the onBindAndValidate methods are called, but the onSubmitRender method is not called instead the method in the handleRenderRequest of the class which implements Controller is called.

    I tried to use AbstractFormController and AbstractController, even then the render method of the Form-based controller was not invoked.

    The mapping

    Code:
    <bean id="portletModeParameterHandlerMapping" class="org.springframework.web.portlet.handler.PortletModeParameterHandlerMapping">
            <property name="order" value="10"/>
            <property name="portletModeParameterMap">
                <map>
                    <entry key="view">
                	<map>
                        <entry key="hello"><ref bean="displayHandler"/></entry>
                        <entry key="AAPage"><ref bean="byaForm"/></entry>
                        <entry key="BBPage"><ref bean="asForm"/></entry>
                        <entry key="CCPage"><ref bean="gsForm"/></entry>
                        <entry key="thankYouPage"><ref bean="displayHandler"/></entry>
                    </map>
                    </entry>
    			</map>
    		</property>        
        </bean>
    The displayHandler implements Controller and the FormBased Controller extends SimpleFormController.

    Could you please reply me why the render method of the SimpleFormController is not called.

    Thanks,
    Shiva

  • #2
    Did you check the portlet interceptors properly?

    Comment


    • #3
      Yes I guess the interceptor did the trick. But bit busy with other stuff. So need to work on that.

      Thanks,
      Shiva

      Comment


      • #4
        Ashik is correct -- it is probably an Interceptor issue.

        The key issue is that the mapping is used twice -- once for the ActionRequest and again for the RenderRequest. When using a parameter for the mapping, you need to make sure it is carried forward from the ActionRequest to the RenderRequest, either by using the ParameterMappingInterceptor or by calling ActionResponse.setRenderParameter yourself to preserve the necessary parameter and value.

        Comment


        • #5
          Thanks, we got it working using the interceptor.

          Comment

          Working...
          X