1 package org.apache.turbine.modules.pages; 2 3 18 19 import org.apache.turbine.services.template.TurbineTemplate; 20 import org.apache.turbine.util.RunData; 21 import org.apache.turbine.util.TurbineException; 22 23 74 public class TemplatePage 75 extends DefaultPage 76 { 77 84 protected void doBuildAfterAction(RunData data) 85 throws Exception 86 { 87 if (!data.hasScreen()) 92 { 93 String template = data.getTemplateInfo().getScreenTemplate(); 97 98 String layoutTemplate = 100 TurbineTemplate.getLayoutTemplateName(template); 101 data.getTemplateInfo().setLayoutTemplate(layoutTemplate); 102 103 String screen = TurbineTemplate.getScreenName(template); 104 105 if (screen == null) 106 { 107 String errMsg = "Couldn't map Template " 108 + template + " to any Screen class!"; 109 log.error(errMsg); 110 throw new TurbineException(errMsg); 111 } 112 data.setScreen(screen); 113 } 114 } 115 } 116 | Popular Tags |