You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2003/07/15 10:26:16 UTC
cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/velocity TurbineVelocity.java TurbineVelocityService.java VelocityService.java
henning 2003/07/15 01:26:16
Modified: src/java/org/apache/turbine/services/velocity
TurbineVelocity.java TurbineVelocityService.java
VelocityService.java
Log:
- Add a new method, which really returns a blank context object without any
tools added to the context.
- make getService() public
Revision Changes Path
1.7 +16 -3 jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocity.java
Index: TurbineVelocity.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocity.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TurbineVelocity.java 14 Mar 2003 17:25:15 -0000 1.6
+++ TurbineVelocity.java 15 Jul 2003 08:26:16 -0000 1.7
@@ -86,7 +86,7 @@
*
* @return a VelocityService implementation instance
*/
- protected static VelocityService getService()
+ public static VelocityService getService()
{
return (VelocityService) TurbineServices
.getInstance().getService(VelocityService.SERVICE_NAME);
@@ -158,13 +158,26 @@
}
/**
- * This method returns a blank Context object.
+ * This method returns a blank Context object, which
+ * also contains the global context object. Do not use
+ * this method if you need an empty context object! Use
+ * getNewContext for this.
*
* @return A WebContext.
*/
public static Context getContext()
{
return getService().getContext();
+ }
+
+ /**
+ * This method returns a new, empty Context object.
+ *
+ * @return A WebContext.
+ */
+ public static Context getNewContext()
+ {
+ return getService().getNewContext();
}
/**
1.23 +12 -1 jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java
Index: TurbineVelocityService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/TurbineVelocityService.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- TurbineVelocityService.java 11 Apr 2003 14:07:08 -0000 1.22
+++ TurbineVelocityService.java 15 Jul 2003 08:26:16 -0000 1.23
@@ -238,6 +238,17 @@
}
/**
+ * This method returns a new, empty Context object.
+ *
+ * @return A WebContext.
+ */
+ public Context getNewContext()
+ {
+ Context ctx = new VelocityContext();
+ return ctx;
+ }
+
+ /**
* Create a Context from the RunData object. Adds a pointer to
* the RunData object to the VelocityContext so that RunData
* is available in the templates.
1.10 +8 -1 jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/VelocityService.java
Index: VelocityService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/velocity/VelocityService.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- VelocityService.java 19 Mar 2003 16:09:47 -0000 1.9
+++ VelocityService.java 15 Jul 2003 08:26:16 -0000 1.10
@@ -135,6 +135,13 @@
Context getContext();
/**
+ * This method returns a new, empty Context object.
+ *
+ * @return A WebContext.
+ */
+ Context getNewContext();
+
+ /**
* Create a Context from the RunData object. Adds a pointer to
* the RunData object to the Context so that RunData is available in
* the templates.
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org