PDA

View Full Version : SucessView not going through Controller (Spring 1.1.2)


klotfi
Nov 27th, 2004, 09:41 PM
I just upgraded to Sprint 1.1.2 from 1.0.2 and am having a problem with any page that has a successView that has a controller. For some reason when it goes to the successView it is not going through the controller for that page. It simply pulls the tile listed in the sucessView and displays it. Here is an example of what I am talking about.

I have a contactMerchant page that is that successView of TransactionHistory. The contactMerchant page is processed properly and routed to the sucessView, but it never actually goes through the controller for the transactionHistory. It simply pulls the tile listed in the successView and displays it. Here is the info from the ...-servlet.xml file

<bean id="contactMerchantController" class="com.stickycard.ui.ContactMerchantController">
<property name="formView"><value>.contactMerchant</value></property>
<property name="successView"><value>.transactionHistory</value></property>
<property name="commandName"><value>contactMerchant</value></property>
<property name="commandClass"><value>com.stickycard.ui.ContactMerchantForm</value></property>

Is there a new parameter that needs to be specified in the xml file? I threw in some logging on the .transactionHistory Controller and it is never being called for this sequence.

Finally I am extending the AbstractCommandController for transactionHistoryController. Here is a code snippet for that just in case that has something to do with it.



public class TransactionHistoryController extends AbstractCommandController {


private String viewName;

protected ModelAndView handle(HttpServletRequest request,
HttpServletResponse response,
Object command,
BindException errors) throws Exception {

.....
return new ModelAndView(getViewName(), errors.getModel());
}



Any suggestions?

klotfi
Nov 28th, 2004, 05:40 AM
I found the solution using the redirect notation in the successview. Here is a link just in case someone else is interested.

http://opensource.atlassian.com/projects/spring/browse/SPR-387