1 17 package net.sf.packtag.tag; 18 19 import javax.servlet.jsp.JspWriter ; 20 21 import net.sf.packtag.implementation.JsminPackStrategy; 22 import net.sf.packtag.strategy.PackStrategy; 23 24 25 26 32 public class ScriptTag extends BaseTag { 33 34 private static final long serialVersionUID = -5324074433734258409L; 35 36 private final static String SCRIPT_START = "<script type=\"text/javascript\" language=\"JavaScript\" SRC=\""; 38 private final static String SCRIPT_END_SOLO = "</script>"; 39 private final static String SCRIPT_END = "\">" + SCRIPT_END_SOLO; 40 41 42 protected void writeResouce(JspWriter writer, String path) throws Exception { 43 writer.write(SCRIPT_START + path + SCRIPT_END); 44 } 45 46 47 protected PackStrategy getPackStrategy() throws Exception { 48 String className = getPackStrategyClassName("script"); 49 if ((className == null) || className.equals(BaseTag.EMPTY_STRING)) { 50 return new JsminPackStrategy(); 51 } 52 return (PackStrategy)Class.forName(className).newInstance(); 53 } 54 55 56 protected String getResourceExtension() { 57 return "js"; 58 } 59 60 } 61 | Popular Tags |