1 13 package com.tonbeller.wcf.log; 14 15 import java.net.URL ; 16 17 import javax.servlet.jsp.JspException ; 18 19 import org.w3c.dom.Document ; 20 21 import com.tonbeller.wcf.component.Component; 22 import com.tonbeller.wcf.component.ComponentTag; 23 import com.tonbeller.wcf.controller.RequestContext; 24 import com.tonbeller.wcf.form.FormDocument; 25 import com.tonbeller.wcf.utils.ResourceLocator; 26 import com.tonbeller.wcf.utils.XmlUtils; 27 28 public class LogTag extends ComponentTag { 29 30 String xmlUri; 31 String logDir; 32 33 36 public Component createComponent(RequestContext context) throws JspException { 37 try { 38 39 URL url = 41 ResourceLocator.getResource(context.getServletContext(), context.getLocale(), xmlUri); 42 Document doc = XmlUtils.parse(url); 43 44 FormDocument.replaceI18n(context, doc, null); 46 47 return new LogForm(id, null, doc, logDir); 49 } 50 catch (Exception e) { 51 throw new JspException (e); 52 } 53 } 54 55 public void setXmlUri(String xmlUri) { 56 this.xmlUri = xmlUri; 57 } 58 59 63 public void setLogDir(String logDir) { 64 this.logDir = logDir; 65 } 66 67 } 68 | Popular Tags |