spring portlet mvc multiple annotated controllers rendermapping problem
Hello SpringForum,
Thanks for the response about log4j in weblogic, and we are looking at that.
Here is another issue I have run into, also using JSR286 JDeveloper 11.1.1.4/weblogic. I am changing an application from 4 portlets to only 1 portlet. I am keeping the original controllers. I am using RenderParameters to navigate to annotated @RenderMapping methods to process each view. I am using actionUrs to navigate to annotated @ActionMapping methods.
I find that the first view must be default so the initial render method has no label - @RenderMapping.
All other methods have specific labels.
The problem I have is I am unable to map to Controller 2 from Controller 1 action method like so:
User first runs app --> default @RenderMapping method in Controller 1 is invoked and jsp is displayed.
User picks an action - matching @ActionMapping in Controller 1 executes.
*problem * Controller 1 action sets a render parameter like so "response.setRenderParameter("wtf_view", "searchView");"
The @RenderMapping target exists in Controller 2 - @RenderMapping(params="wtf_view=searchView") - but the default method in Controller 1 is what executes and remains on the original jsp.
I have looked at my debug statements (none from Spring though) and determined that the RenderParameters were properly set. Thinking that the order of controllers found in the component scan was the issue I defined the beahs in the app-portlet.xml. However it did not fix it either.
Here is the app-portlet.xml:
<code>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:annotation-config/>
<context:component-scan base-package="gov.opm.epic"
use-default-filters="true">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Control ler"/>
</context:component-scan>
<bean id="b1"
class="gov.opm.epic.roi.controller.CaseReportContr oller"/>
<bean id="b2"
class="gov.opm.epic.roi.controller.QueryResultCont roller"/>
<bean id="b3"
class="gov.opm.epic.roi.controller.SearchControlle r"/>
<bean id="b4" class="gov.opm.epic.roi.controller.RoiMain"/>
<bean id="b5"
class="gov.opm.epic.roi.controller.AdvancedSearchC ontroller"/>
<bean class="org.springframework.web.portlet.mvc.annotat ion.DefaultAnnotationHandlerMapping">
<property name="order" value="10"/>
</bean>
</beans>
</code>
Your time is appreciated!
Thanks,
Steve
We have the same problem Spring version 3.1.1 in liferay 6.1
We have even more then two controllers, if we put all the RenderMapping Methods together in the Controller which have also the default render mapping @RenderMapping() then the mapping works pretty well.
But if we moved the RenderMapping to the suitable Controllers the first RenderMapping which resists in a foreign Controller, leads to a call on the default RenderMapping and not what was expected in the suitable RenderMapping in the second or third Controller.
We cleaned up the Project as well and also the spring-context.xml file but nothing worked for us ...
Maybe some one knows what to do except moving all RenderMethods to one Controller. :-)