Results 1 to 5 of 5

Thread: spring portlet - SimpleFormController

  1. #1
    Join Date
    Dec 2005
    Location
    SFO, CA
    Posts
    15

    Default 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. #2
    Join Date
    Dec 2004
    Location
    Fremont, CA, USA
    Posts
    18

    Post

    Did you check the portlet interceptors properly?
    Ashik Uzzaman
    Fremont, California, USA
    http://ashikuzzaman.wordpress.com

  3. #3
    Join Date
    Dec 2005
    Location
    SFO, CA
    Posts
    15

    Default

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

    Thanks,
    Shiva

  4. #4
    Join Date
    Sep 2004
    Location
    Arizona, USA
    Posts
    383

    Default

    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.

  5. #5
    Join Date
    Dec 2005
    Location
    SFO, CA
    Posts
    15

    Default

    Thanks, we got it working using the interceptor.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •