incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r706169 - /incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/ScriptHelper.java
Date Mon, 20 Oct 2008 09:40:58 GMT
Author: fmeschbe
Date: Mon Oct 20 02:40:58 2008
New Revision: 706169

URL: http://svn.apache.org/viewvc?rev=706169&view=rev
Log:
SLING-705 Add single forward method to ScriptHelper implementation

Modified:
    incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/ScriptHelper.java

Modified: incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/ScriptHelper.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/ScriptHelper.java?rev=706169&r1=706168&r2=706169&view=diff
==============================================================================
--- incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/ScriptHelper.java
(original)
+++ incubator/sling/trunk/scripting/core/src/main/java/org/apache/sling/scripting/core/ScriptHelper.java
Mon Oct 20 02:40:58 2008
@@ -119,7 +119,7 @@
     public void include(String path, RequestDispatcherOptions options) {
         final RequestDispatcher dispatcher = getRequest().getRequestDispatcher(
             path, options);
-
+        
         if (dispatcher != null) {
             try {
                 dispatcher.include(getRequest(), getResponse());
@@ -130,6 +130,22 @@
             }
         }
     }
+    
+    /** Forward the request to another resource, using specified options */
+    public void forward(String path, RequestDispatcherOptions options) {
+        final RequestDispatcher dispatcher = getRequest().getRequestDispatcher(
+            path, options);
+
+        if (dispatcher != null) {
+            try {
+                dispatcher.forward(getRequest(), getResponse());
+            } catch (IOException ioe) {
+                throw new SlingIOException(ioe);
+            } catch (ServletException se) {
+                throw new SlingServletException(se);
+            }
+        }
+    }
 
     /**
      * @see org.apache.sling.api.scripting.SlingScriptHelper#getService(java.lang.Class)



Mime
View raw message