velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r531972 - in /velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools: struts/ view/context/ view/i18n/ view/servlet/ view/tools/
Date Tue, 24 Apr 2007 15:12:18 GMT
Author: nbubna
Date: Tue Apr 24 08:12:15 2007
New Revision: 531972

URL: http://svn.apache.org/viewvc?view=rev&rev=531972
Log:
minimize use of deprecated versions of ServletUtils and ViewContext

Modified:
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/FormTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/TilesTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/context/ChainedContext.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/i18n/MultiViewsTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/servlet/ServletToolboxManager.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/AbstractPagerTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/BrowserSnifferTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ContextTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/CookieTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ImportTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/LinkTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ParameterParser.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewRenderTool.java
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewResourceTool.java

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/FormTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/FormTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/FormTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/FormTool.java
Tue Apr 24 08:12:15 2007
@@ -23,7 +23,7 @@
 import javax.servlet.http.HttpSession;
 
 import org.apache.struts.action.ActionForm;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 
 /**

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java
Tue Apr 24 08:12:15 2007
@@ -25,7 +25,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.struts.util.MessageResources;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * <p>Abstract view tool that provides access to Struts' message resources.</p>

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/TilesTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/TilesTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/TilesTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/TilesTool.java
Tue Apr 24 08:12:15 2007
@@ -38,7 +38,7 @@
 import org.apache.struts.tiles.TilesUtil;
 import org.apache.velocity.context.Context;
 import org.apache.velocity.tools.view.ImportSupport;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * View tool to use struts-tiles with Velocity.

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java
Tue Apr 24 08:12:15 2007
@@ -43,7 +43,7 @@
 import org.apache.struts.util.ModuleUtils;
 import org.apache.struts.validator.Resources;
 import org.apache.struts.validator.ValidatorPlugIn;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * <p>View tool that works with Struts Validator to
@@ -169,7 +169,7 @@
         this.session = request.getSession(false);
         this.app = context.getServletContext();
 
-        Boolean b = (Boolean)context.getAttribute(ViewContext.XHTML);
+        Boolean b = (Boolean)context.getAttribute("XHTML");
         if (b != null)
         {
             this.xhtml = b.booleanValue();

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/context/ChainedContext.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/context/ChainedContext.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/context/ChainedContext.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/context/ChainedContext.java
Tue Apr 24 08:12:15 2007
@@ -30,6 +30,7 @@
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.context.Context;
+import org.apache.velocity.tools.view.context.ViewContext;
 
 /**
  * <p>Velocity context implementation specific to the Servlet environment.</p>

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/i18n/MultiViewsTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/i18n/MultiViewsTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/i18n/MultiViewsTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/i18n/MultiViewsTool.java
Tue Apr 24 08:12:15 2007
@@ -23,7 +23,7 @@
 import javax.servlet.ServletContext;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.context.Context;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * Allows for transparent content negotiation in a manner mimicking
@@ -146,7 +146,7 @@
     {
         String localizedName = name + '.' + language;
         // templateExists() checks for static content as well
-        if (!engine.templateExists(localizedName))
+        if (!engine.resourceExists(localizedName))
         {
             // Fall back to the default lanaguage.
             String defaultLangSuffix = '.' + defaultLanguage;
@@ -158,7 +158,7 @@
             else
             {
                 localizedName = name + defaultLangSuffix;
-                if (!engine.templateExists(localizedName))
+                if (!engine.resourceExists(localizedName))
                 {
                     localizedName = name;
                 }

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/servlet/ServletToolboxManager.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/servlet/ServletToolboxManager.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/servlet/ServletToolboxManager.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/servlet/ServletToolboxManager.java
Tue Apr 24 08:12:15 2007
@@ -36,6 +36,7 @@
 import org.apache.velocity.tools.view.ToolInfo;
 import org.apache.velocity.tools.view.XMLToolboxManager;
 import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ServletUtils;
 
 
 /**

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/AbstractPagerTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/AbstractPagerTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/AbstractPagerTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/AbstractPagerTool.java
Tue Apr 24 08:12:15 2007
@@ -26,7 +26,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * <p>Abstract view tool for doing request-based pagination of

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/BrowserSnifferTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/BrowserSnifferTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/BrowserSnifferTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/BrowserSnifferTool.java
Tue Apr 24 08:12:15 2007
@@ -25,7 +25,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  *  <p>browser-sniffing tool (session or request scope requested, session scope advised).</p>

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ContextTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ContextTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ContextTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ContextTool.java
Tue Apr 24 08:12:15 2007
@@ -32,7 +32,7 @@
 import org.apache.velocity.context.Context;
 import org.apache.velocity.tools.generic.ValueParser;
 import org.apache.velocity.tools.view.context.ChainedContext;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * <p>View tool for convenient access to {@link ViewContext} data and

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/CookieTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/CookieTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/CookieTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/CookieTool.java
Tue Apr 24 08:12:15 2007
@@ -23,7 +23,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * <p>View tool for convenient cookie access and creation.</p>

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ImportTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ImportTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ImportTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ImportTool.java
Tue Apr 24 08:12:15 2007
@@ -22,7 +22,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.velocity.tools.view.ImportSupport;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * General-purpose text-importing view tool for templates.

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/LinkTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/LinkTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/LinkTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/LinkTool.java
Tue Apr 24 08:12:15 2007
@@ -34,8 +34,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.velocity.tools.generic.ValueParser;
-import org.apache.velocity.tools.view.context.ViewContext;
-import org.apache.velocity.tools.view.servlet.ServletUtils;
+import org.apache.velocity.tools.view.ViewContext;
+import org.apache.velocity.tools.view.ServletUtils;
 
 /**
  * View tool to make building URIs pleasant and fun!
@@ -364,7 +364,8 @@
         this.request = context.getRequest();
         this.response = context.getResponse();
         this.application = context.getServletContext();
-        Boolean b = (Boolean)context.getAttribute(ViewContext.XHTML);
+        // for backwards compatibility, honor the old key...
+        Boolean b = (Boolean)context.getAttribute("XHTML");
         if (b != null)
         {
             setXhtml(b.booleanValue());

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ParameterParser.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ParameterParser.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ParameterParser.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ParameterParser.java
Tue Apr 24 08:12:15 2007
@@ -22,7 +22,7 @@
 import java.util.Map;
 import javax.servlet.ServletRequest;
 import org.apache.velocity.tools.generic.ValueParser;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * <p>Utility class for easy parsing of {@link ServletRequest} parameters.</p>

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewRenderTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewRenderTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewRenderTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewRenderTool.java
Tue Apr 24 08:12:15 2007
@@ -21,7 +21,7 @@
 
 import org.apache.velocity.context.Context;
 import org.apache.velocity.tools.generic.RenderTool;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * This tool expose methods to evaluate the given

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewResourceTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewResourceTool.java?view=diff&rev=531972&r1=531971&r2=531972
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewResourceTool.java
(original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/view/tools/ViewResourceTool.java
Tue Apr 24 08:12:15 2007
@@ -21,7 +21,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import org.apache.velocity.tools.generic.ResourceTool;
-import org.apache.velocity.tools.view.context.ViewContext;
+import org.apache.velocity.tools.view.ViewContext;
 
 /**
  * <p>Tool for accessing ResourceBundles and formatting messages therein.</p>



Mime
View raw message