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 [EMAIL PROTECTED] #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,
* "option:xyz");
@@ -73,13 +73,13 @@
* dispatcher.include(getRequest(), getResponse());
* }
* </pre>
- *
+ *
* <p>
* This method creates a <code>RequestDispatcherOptions</code> object by
* calling the
* [EMAIL PROTECTED]
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("option", "xyz");
@@ -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("option", "xyz");
+ * 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();
}