1 5 package org.exoplatform.portlet.exomvc.config; 6 7 import org.exoplatform.portlet.exomvc.Page; 8 import org.exoplatform.portlet.exomvc.JSPPage; 9 14 public class JSPPageConfig extends PageConfig { 15 private String jspPage_ ; 16 private String pageClassName_ = "org.exoplatform.portlet.mvc.JSPPage"; 17 private JSPPage cache_ ; 18 19 public String getJSPPage() { return jspPage_ ; } 20 public JSPPageConfig setJSPPage(String className) { 21 jspPage_ = className ; 22 return this ; 23 } 24 25 public String getPageClassName() { return pageClassName_ ; } 26 public JSPPageConfig setPageClassName(String s) { 27 pageClassName_ = s ; 28 return this ; 29 } 30 31 public Page getPageObject(Configuration configuration) throws Exception { 32 if(cache_ != null) return cache_ ; 33 synchronized(configuration) { 34 ClassLoader cl = Thread.currentThread().getContextClassLoader() ; 35 Class clazz = cl.loadClass(pageClassName_) ; 36 cache_ = (JSPPage) clazz.newInstance() ; 37 cache_.setConfiguration(configuration) ; 38 cache_.setPageName(getPageName()) ; 39 cache_.setJSPPage(jspPage_) ; 40 } 41 return cache_ ; 42 } 43 } | Popular Tags |