InsertTasksController.java :  » Swing-Library » OpenSwing-2.1.8 » demo18 » server » Java Open Source

Java Open Source » Swing Library » OpenSwing 2.1.8 
OpenSwing 2.1.8 » demo18 » server » InsertTasksController.java
package demo18.server;

import org.springframework.web.servlet.mvc.Controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.openswing.springframework.web.servlet.view.OpenSwingViewResolver;
import java.util.ArrayList;
import org.openswing.swing.message.send.java.Command;
import org.openswing.springframework.web.servlet.handler.OpenSwingHandlerMapping;


/**
 * <p>Title: OpenSwing Framework</p>
 * <p>Description: Spring Controller used to insert tasks.</p>
 * <p>Copyright: Copyright (C) 2006 Mauro Carniel</p>
 * @version 1.0
 */
public class InsertTasksController implements Controller {

  private DemoFacade facade;


  public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView mav = new ModelAndView();
    Command command = (Command)request.getAttribute(OpenSwingHandlerMapping.COMMAND_ATTRIBUTE_NAME);
    mav.addObject(
      OpenSwingViewResolver.RESPONSE_PROPERTY_NAME,
      facade.insertTasks((ArrayList)command.getInputParam())
    );

    return mav;

  }


  public DemoFacade getFacade() {
    return facade;
  }
  public void setFacade(DemoFacade facade) {
    this.facade = facade;
  }


}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.