Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 84496 invoked from network); 11 May 2007 15:05:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 May 2007 15:05:12 -0000 Received: (qmail 69058 invoked by uid 500); 11 May 2007 15:05:18 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 68936 invoked by uid 500); 11 May 2007 15:05:18 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 68925 invoked by uid 99); 11 May 2007 15:05:18 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2007 08:05:18 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2007 08:05:11 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id DDAF81A9838; Fri, 11 May 2007 08:04:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r537204 - in /cocoon/trunk/core: cocoon-core/src/main/java/org/apache/cocoon/servlet/ cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/ cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/envi... Date: Fri, 11 May 2007 15:04:50 -0000 To: cvs@cocoon.apache.org From: vgritsenko@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070511150450.DDAF81A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vgritsenko Date: Fri May 11 08:04:49 2007 New Revision: 537204 URL: http://svn.apache.org/viewvc?view=rev&rev=537204 Log: whitespace, comments Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Context.java cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpContext.java Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java?view=diff&rev=537204&r1=537203&r2=537204 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/servlet/RequestProcessor.java Fri May 11 08:04:49 2007 @@ -59,13 +59,15 @@ /** The servlet context. */ protected final ServletContext servletContext; + /** Cocoon environment context. */ + protected final Context environmentContext; + + /** Configured servlet container encoding. Defaults to ISO-8859-1. */ protected final String containerEncoding; - /** The logger. */ + /** The access logger. */ protected final Logger log; - protected final Context environmentContext; - /** Root Cocoon Bean Factory. */ protected final BeanFactory cocoonBeanFactory; @@ -84,18 +86,22 @@ */ protected RequestListener requestListener; + public RequestProcessor(ServletContext servletContext) { this.servletContext = servletContext; this.cocoonBeanFactory = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); this.settings = (Settings) this.cocoonBeanFactory.getBean(Settings.ROLE); this.servletSettings = new ServletSettings(this.settings); + final String encoding = this.settings.getContainerEncoding(); if ( encoding == null ) { this.containerEncoding = "ISO-8859-1"; } else { this.containerEncoding = encoding; } + this.log = (Logger) this.cocoonBeanFactory.getBean(AvalonUtils.LOGGER_ROLE); + this.processor = this.getProcessor(); this.environmentContext = new HttpContext(this.servletContext); // get the optional request listener @@ -111,7 +117,7 @@ public void setProcessor(Processor processor) { this.processor = processor; } - + protected boolean rethrowExceptions() { return false; } @@ -121,7 +127,7 @@ * on the specified HttpServletResponse. */ public void service(HttpServletRequest request, HttpServletResponse res) - throws ServletException, IOException { + throws ServletException, IOException { // used for timing the processing StopWatch stopWatch = new StopWatch(); stopWatch.start(); @@ -147,11 +153,11 @@ if (getLogger().isErrorEnabled()) { getLogger().error("Problem with Cocoon servlet", e); } - + if (rethrowExceptions()) { throw new ServletException(e); } - + RequestUtil.manageException(request, res, null, uri, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Problem in creating the Environment", null, null, e, @@ -190,7 +196,7 @@ if (rethrowExceptions()) { throw new ServletException(e); } - + RequestUtil.manageException(request, res, env, uri, HttpServletResponse.SC_NOT_FOUND, "Resource Not Found", @@ -258,7 +264,7 @@ out.println((hide) ? " -->" : "

"); } } - + /* * Servlet Specification 2.2, 6.5 Closure of Response Object: * Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Context.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Context.java?view=diff&rev=537204&r1=537203&r2=537204 ============================================================================== --- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Context.java (original) +++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-api/src/main/java/org/apache/cocoon/environment/Context.java Fri May 11 08:04:49 2007 @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,6 +28,7 @@ * Defines an interface to provide context information. * * Since 2.2 this interface extends the {@link ServletContext} interface. + * * @version $Id$ */ public interface Context extends ServletContext { @@ -36,19 +37,18 @@ void setAttribute(String name, Object value); + void removeAttribute(String name); + + Enumeration getAttributeNames(); + /** * Utility method for getting a Map view of the context attributes. * Returns a Map with context attributes. * * @return a Map containing the context attributes. - * * @since 2.2 */ Map getAttributes(); - - void removeAttribute(String name); - - Enumeration getAttributeNames(); URL getResource(String path) throws MalformedURLException; Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpContext.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpContext.java?view=diff&rev=537204&r1=537203&r2=537204 ============================================================================== --- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpContext.java (original) +++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/environment/http/HttpContext.java Fri May 11 08:04:49 2007 @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,8 +27,8 @@ import org.apache.cocoon.environment.impl.AbstractContext; /** - * * Implements the {@link org.apache.cocoon.environment.Context} interface + * * @version $Id$ */ public final class HttpContext extends AbstractContext { @@ -65,7 +65,7 @@ } public InputStream getResourceAsStream(String path) { - return servletContext.getResourceAsStream(path); + return servletContext.getResourceAsStream(path); } public String getRealPath(String path) { @@ -103,7 +103,7 @@ * ServletContext. To use them you have to downcast Cocoon's Context * to this HttpContext until we decide to add them to the Context * interface too. - * + * * The following methods are deprecated since Servlet API 2.0 or 2.1 * and will not be implemented here: * - public Servlet getServlet(String name)