1 34 35 36 package com.micronova.jsp.tag; 37 38 import java.io.*; 39 import java.util.*; 40 import javax.servlet.*; 41 42 import com.micronova.util.*; 43 import com.micronova.util.cc.html.Parser; 44 45 public class ParseHtmlTag extends YuzuTag 46 { 47 protected NestedMap _controlMap; 48 49 protected void init() 50 { 51 super.init(); 52 53 _controlMap = new NestedMap(); 54 } 55 56 public void setPrefix(Object expression) throws Exception 57 { 58 _controlMap.put("prefix", (String )evaluateAttribute("prefix", expression, String .class)); 59 } 60 61 public void setRootName(Object expression) throws Exception 62 { 63 _controlMap.put("rootName", (String )evaluateAttribute("rootName", expression, String .class)); 64 } 65 66 public void setStrategy(Object expression) throws Exception 67 { 68 _controlMap.put("strategy", (String )evaluateAttribute("strategy", expression, String .class)); 69 } 70 71 public void setExclude(Object expression) throws Exception 72 { 73 _controlMap.put("exclude", evaluateAttribute("exclude", expression, String .class)); 74 } 75 76 public void setInclude(Object expression) throws Exception 77 { 78 _controlMap.put("include", evaluateAttribute("include", expression, String .class)); 79 } 80 81 protected Object processValue(Object tagValue) throws Exception 82 { 83 if (tagValue != null) 84 { 85 try 86 { 87 return XMLUtil.parseHtml(tagValue, _controlMap); 88 } 89 catch (Exception e) 90 { 91 ServletContext context = pageContext.getServletContext(); 92 93 context.log("HtmlTag:BEGIN ========"); 94 context.log(tagValue.toString()); 95 context.log("HtmlTag:END ========"); 96 97 throw e; 98 } 99 } 100 else 101 { 102 return null; 103 } 104 } 105 } 106 | Popular Tags |