ListProcess.java
上传用户:ahit0551
上传日期:2009-04-15
资源大小:2345k
文件大小:2k
源码类别:

xml/soap/webservice

开发平台:

Java

  1. package name.xio.xiorkflow.web;
  2. import java.util.List;
  3. import javax.servlet.http.HttpServletRequest;
  4. import javax.servlet.http.HttpServletResponse;
  5. import name.xio.xiorkflow.domain.ProcessResult;
  6. import name.xio.xiorkflow.domain.logic.ProcessService;
  7. import name.xio.xml.SimpleXMLWorkShop;
  8. import org.apache.commons.logging.Log;
  9. import org.apache.commons.logging.LogFactory;
  10. import org.springframework.web.servlet.ModelAndView;
  11. import org.springframework.web.servlet.mvc.Controller;
  12. public class ListProcess implements Controller {
  13.     public ModelAndView handleRequest(HttpServletRequest request,
  14.             HttpServletResponse response) throws Exception {
  15.         log.info("list process.");
  16.         response.setContentType("text/xml");
  17.         response.setHeader("Cache-Control", "no-cache");
  18.         List list = this.getProcessService().listProcess();
  19.         SimpleXMLWorkShop.outputXML(ProcessResult.convertFilesToXml(list),
  20.                 response.getOutputStream());
  21.         //not redirect to other view,it processed on response
  22.         return null;
  23.     }
  24.     /**
  25.      * @return Returns the processService.
  26.      */
  27.     public ProcessService getProcessService() {
  28.         return processService;
  29.     }
  30.     /**
  31.      * @param processService The processService to set.
  32.      */
  33.     public void setProcessService(ProcessService processService) {
  34.         this.processService = processService;
  35.     }
  36.     private Log log = LogFactory.getLog(ListProcess.class);
  37.     private ProcessService processService;
  38. }