1 16 17 package org.springframework.web.portlet.mvc; 18 19 import javax.portlet.RenderRequest; 20 import javax.portlet.RenderResponse; 21 22 import org.springframework.web.portlet.ModelAndView; 23 24 65 public class ParameterizableViewController extends AbstractController { 66 67 private String viewName; 68 69 70 73 public void setViewName(String viewName) { 74 this.viewName = viewName; 75 } 76 77 80 public String getViewName() { 81 return viewName; 82 } 83 84 protected void initApplicationContext() { 85 if (this.viewName == null) { 86 throw new IllegalArgumentException ("viewName is required"); 87 } 88 } 89 90 91 94 protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) 95 throws Exception { 96 97 return new ModelAndView(getViewName()); 98 } 99 100 } 101 | Popular Tags |