webwork/src/main/webwork/view/taglib/ui ComponentTag.java,1.15,1.16
[email protected] Sun, 16 Nov 2003 17:16:26 -0800
| Newsgroups | gmane.comp.java.open-symphony.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/opensymphony/webwork/src/main/webwork/view/taglib/ui
In directory sc8-pr-cvs1:/tmp/cvs-serv17211/src/main/webwork/view/taglib/ui
Modified Files:
ComponentTag.java
Log Message:
Special handling for velocity templates, speak up if this upsets you, or else be grateful and enjoy it
Index: ComponentTag.java
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/main/webwork/view/taglib/ui/ComponentTag.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ComponentTag.java 9 Feb 2003 18:56:01 -0000 1.15
+++ ComponentTag.java 17 Nov 2003 01:16:24 -0000 1.16
@@ -7,12 +7,14 @@
package webwork.view.taglib.ui;
import org.apache.commons.logging.*;
+import org.apache.velocity.context.Context;
import webwork.config.Configuration;
import webwork.util.ContainUtil;
import webwork.util.BeanUtil;
import webwork.view.taglib.IncludeTag;
import webwork.view.taglib.ParamTag;
import webwork.view.taglib.WebWorkBodyTagSupport;
+import webwork.view.velocity.VelocityHelper;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspTagException;
@@ -172,7 +174,13 @@
String templatePath = "/" + getTemplateDir() + "/" + getTheme() + "/" + template;
if (log.isDebugEnabled())
log.debug("Using template:" + templatePath);
- IncludeTag.include(templatePath, pageContext);
+ if(templatePath.endsWith(".vm"))
+ {
+ Context c = VelocityHelper.getContext(pageContext.getServletContext(), pageContext.getRequest(), pageContext.getResponse());
+ VelocityHelper.merge(c, templatePath, pageContext.getOut());
+ }
+ else
+ IncludeTag.include(templatePath, pageContext);
return EVAL_PAGE;
} catch (Exception e) {
throw new JspTagException("Including component failed:" + toString(e));
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl