FileDocCategorySizeDatePackage
SubmitBikeController.javaAPI DocExample1355Sun Apr 24 17:41:32 BST 2005com.springbook

SubmitBikeController

public class SubmitBikeController extends org.springframework.web.servlet.mvc.SimpleFormController

Fields Summary
private RentABike
facade
Constructors Summary
Methods Summary
protected java.lang.ObjectformBackingObject(javax.servlet.http.HttpServletRequest request)

        Bike bike = new Bike();
        if(request.getParameter("bikeSerialNo") != null) bike = facade.getBike(request.getParameter("bikeSerialNo"));
        return bike;
    
public RentABikegetFacade()

        return facade;
    
public org.springframework.web.servlet.ModelAndViewonSubmit(java.lang.Object command)


        Bike bike = (Bike)command;
        facade.saveBike(bike);
        ModelAndView result = new ModelAndView(new RedirectView(getSuccessView()), "bikeStore", facade);
        System.out.println("successView: " + this.getSuccessView());
        System.out.println("formView: " + this.getFormView());
        System.out.println("facade is null: " + (facade==null));
        System.out.println("modelandview is null: " + (result==null));
        return result;
    
public voidsetFacade(RentABike facade)

        this.facade = facade;