1 package org.apache.turbine.services.jsp.util; 2 3 18 19 import org.apache.commons.logging.Log; 20 import org.apache.commons.logging.LogFactory; 21 22 import org.apache.turbine.modules.NavigationLoader; 23 import org.apache.turbine.services.template.TurbineTemplate; 24 import org.apache.turbine.util.RunData; 25 26 41 public class JspNavigation 42 { 43 44 private static Log log = LogFactory.getLog(JspNavigation.class); 45 46 47 private RunData data; 48 49 54 public JspNavigation(RunData data) 55 { 56 this.data = data; 57 } 58 59 63 public void setTemplate(String template) 64 { 65 data.getTemplateInfo().setNavigationTemplate(template); 66 String module = null; 67 try 68 { 69 module = TurbineTemplate.getNavigationName(template); 70 NavigationLoader.getInstance().exec(data, module); 71 } 72 catch (Exception e) 73 { 74 String message = "Error processing navigation template:" + 75 template + " using module: " + module; 76 log.error(message, e); 77 try 78 { 79 data.getOut().print("Error processing navigation template: " 80 + template + " using module: " + module); 81 } 82 catch (java.io.IOException ioe) 83 { 84 } 85 } 86 } 87 } 88 | Popular Tags |