You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/10/15 15:39:31 UTC
svn commit: r584787 - in
/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice:
CallStackHelper.java ServletServiceContext.java
Author: vgritsenko
Date: Mon Oct 15 06:39:30 2007
New Revision: 584787
URL: http://svn.apache.org/viewvc?rev=584787&view=rev
Log:
javadoc/tabs
Modified:
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/CallStackHelper.java
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/CallStackHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/CallStackHelper.java?rev=584787&r1=584786&r2=584787&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/CallStackHelper.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/CallStackHelper.java Mon Oct 15 06:39:30 2007
@@ -87,7 +87,8 @@
/**
* Use this method for getting the context that should be used for
- * resolving a polymorphic servlet protocol call
+ * resolving a polymorphic servlet protocol call.
+ *
* @return a servlet context
*/
public static ServletContext getBaseServletContext() {
@@ -103,7 +104,8 @@
/**
* Use this method for getting the context that should be used for
- * resolving a servlet protocol call to a super servlet service
+ * resolving a servlet protocol call to a super servlet service.
+ *
* @return a servlet context
*/
public static ServletContext getCurrentServletContext() {
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java?rev=584787&r1=584786&r2=584787&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java Mon Oct 15 06:39:30 2007
@@ -542,44 +542,45 @@
*/
public void forward(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
- this.forward(request, response, false);
+ forward(request, response, false);
}
protected void forward(ServletRequest request, ServletResponse response, boolean superCall)
throws ServletException, IOException {
try {
- StatusRetrievableWrappedResponse wrappedResponse = new StatusRetrievableWrappedResponse((HttpServletResponse)response);
+ StatusRetrievableWrappedResponse wrappedResponse = new StatusRetrievableWrappedResponse((HttpServletResponse) response);
//FIXME: I think that Cocoon should always set status code on its own
wrappedResponse.setStatus(HttpServletResponse.SC_OK);
if (!superCall) {
// It is important to set the current context each time
// a new context is entered, this is used for the servlet
// protocol
- CallStackHelper.enterServlet(ServletServiceContext.this, (HttpServletRequest)request, (HttpServletResponse)wrappedResponse);
+ CallStackHelper.enterServlet(ServletServiceContext.this, (HttpServletRequest) request, wrappedResponse);
} else {
// A super servlet service should be called in the context of
// the called servlet service to get polymorphic calls resolved
// in the right way. We still need to register the
// current context for resolving super calls relative it.
- CallStackHelper.enterSuperServlet(ServletServiceContext.this, (HttpServletRequest)request, (HttpServletResponse)wrappedResponse);
+ CallStackHelper.enterSuperServlet(ServletServiceContext.this, (HttpServletRequest) request, wrappedResponse);
}
+
ServletException se = null;
try {
ServletServiceContext.this.servlet.service(request, wrappedResponse);
- }
- catch (ServletException e) {
+ } catch (ServletException e) {
se = e;
}
- int status = wrappedResponse.getStatus();
- if (se != null || (status < 200 || status >= 400)) {
- wrappedResponse.reset();
- NamedDispatcher _super = (NamedDispatcher) ServletServiceContext.this.getNamedDispatcher(SUPER);
- if (_super != null) {
- _super.forward(request, wrappedResponse);
- }
- else
- throw se;
- }
+
+ int status = wrappedResponse.getStatus();
+ if (se != null || (status < 200 || status >= 400)) {
+ wrappedResponse.reset();
+ NamedDispatcher _super = (NamedDispatcher) ServletServiceContext.this.getNamedDispatcher(SUPER);
+ if (_super != null) {
+ _super.forward(request, wrappedResponse);
+ } else {
+ throw se;
+ }
+ }
} finally {
CallStackHelper.leaveServlet();