1 24 package org.riotfamily.common.web.controller; 25 26 import java.util.Collection ; 27 28 import javax.servlet.http.HttpServletRequest ; 29 import javax.servlet.http.HttpServletResponse ; 30 31 import org.riotfamily.common.util.PackageLister; 32 import org.springframework.web.servlet.ModelAndView; 33 import org.springframework.web.servlet.mvc.Controller; 34 35 public class PackageListController implements Controller { 36 37 public static final String MODEL_NAME = "packages"; 38 39 private String [] patterns; 40 41 private String viewName; 42 43 public void setPatterns(String [] patterns) { 44 this.patterns = patterns; 45 } 46 47 public void setViewName(String viewName) { 48 this.viewName = viewName; 49 } 50 51 public ModelAndView handleRequest(HttpServletRequest request, 52 HttpServletResponse response) throws Exception { 53 54 Collection packages = PackageLister.listPackages(patterns); 55 return new ModelAndView(viewName, MODEL_NAME, packages); 56 } 57 } 58 | Popular Tags |