incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r706168 - /incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
Date Mon, 20 Oct 2008 09:39:39 GMT
Author: fmeschbe
Date: Mon Oct 20 02:39:39 2008
New Revision: 706168

URL: http://svn.apache.org/viewvc?rev=706168&view=rev
Log:
SLING-705 Add single forward method to SlingScriptHelper interface

Modified:
    incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java

Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java?rev=706168&r1=706167&r2=706168&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
(original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java
Mon Oct 20 02:39:39 2008
@@ -53,7 +53,7 @@
     /**
      * Same as {@link #include(String,RequestDispatcherOptions)}, but using
      * empty options.
-     *
+     * 
      * @throws SlingIOException Wrapping a <code>IOException</code> thrown
      *             while handling the include.
      * @throws SlingServletException Wrapping a <code>ServletException</code>
@@ -65,7 +65,7 @@
      * Helper method to include the result of processing the request for the
      * given <code>path</code> and <code>requestDispatcherOptions</code>.
      * This method is intended to be implemented as follows:
-     *
+     * 
      * <pre>
      * RequestDispatcher dispatcher = getRequest().getRequestDispatcher(path,
      *     &quot;option:xyz&quot;);
@@ -73,13 +73,13 @@
      *     dispatcher.include(getRequest(), getResponse());
      * }
      * </pre>
-     *
+     * 
      * <p>
      * This method creates a <code>RequestDispatcherOptions</code> object by
      * calling the
      * {@link RequestDispatcherOptions#RequestDispatcherOptions(String)}
      * constructor.
-     *
+     * 
      * @param path The path to the resource to include.
      * @param requestDispatcherOptions influence the rendering of the included
      *            Resource
@@ -96,7 +96,7 @@
      * Helper method to include the result of processing the request for the
      * given <code>path</code> and <code>options</code>. This method
is
      * intended to be implemented as follows:
-     *
+     * 
      * <pre>
      * RequestDispatcherOptions opts = new RequestDispatcherOptions();
      * opts.put(&quot;option&quot;, &quot;xyz&quot;);
@@ -105,7 +105,7 @@
      *     dispatcher.include(getRequest(), getResponse());
      * }
      * </pre>
-     *
+     * 
      * @param path The path to the resource to include.
      * @param options influence the rendering of the included Resource
      * @throws SlingIOException Wrapping a <code>IOException</code> thrown
@@ -118,8 +118,33 @@
     void include(String path, RequestDispatcherOptions options);
 
     /**
+     * Helper method to forward the request to a Servlet or script for the given
+     * <code>path</code> and <code>options</code>. This method is
intended
+     * to be implemented as follows:
+     * 
+     * <pre>
+     * RequestDispatcherOptions opts = new RequestDispatcherOptions();
+     * opts.put(&quot;option&quot;, &quot;xyz&quot;);
+     * RequestDispatcher dispatcher = getRequest().getRequestDispatcher(path, opts);
+     * if (dispatcher != null) {
+     *     dispatcher.forward(getRequest(), getResponse());
+     * }
+     * </pre>
+     * 
+     * @param path The path to the resource to forward the request to.
+     * @param options influence the rendering of the forwarded Resource
+     * @throws SlingIOException Wrapping a <code>IOException</code> thrown
+     *             while handling the forward.
+     * @throws SlingServletException Wrapping a <code>ServletException</code>
+     *             thrown while handling the forward.
+     * @throws IllegalStateException If the respoonse has already been committed
+     * @see RequestDispatcherOptions
+     */
+    void forward(String path, RequestDispatcherOptions options);
+
+    /**
      * Lookup a single service
-     *
+     * 
      * @param serviceType The type (interface) of the service.
      * @return The service instance, or null if the service is not available.
      */
@@ -127,7 +152,7 @@
 
     /**
      * Lookup one or several services
-     *
+     * 
      * @param serviceType The type (interface) of the service.
      * @param filter An optional filter (LDAP-like, see OSGi spec)
      * @return The services object or null.
@@ -138,8 +163,8 @@
             String filter);
 
     /**
-     * Dispose the helper.
-     * This method can be used to clean up the script helper after the script is run.
+     * Dispose the helper. This method can be used to clean up the script helper
+     * after the script is run.
      */
     void dispose();
 }



Mime
View raw message