cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From froehl...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/servlet CocoonServlet.java
Date Wed, 13 Feb 2002 09:35:35 GMT
froehlich    02/02/13 01:35:35

  Modified:    src/java/org/apache/cocoon/servlet CocoonServlet.java
  Log:
  applied patch from  MIYABE Tatsuhiko [miyabe@jzf.co.jp].
  Form encoding enhancement!
  
  Revision  Changes    Path
  1.9       +25 -2     xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java
  
  Index: CocoonServlet.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/servlet/CocoonServlet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CocoonServlet.java	12 Feb 2002 16:18:45 -0000	1.8
  +++ CocoonServlet.java	13 Feb 2002 09:35:35 -0000	1.9
  @@ -119,7 +119,7 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
  - * @version CVS $Id: CocoonServlet.java,v 1.8 2002/02/12 16:18:45 vgritsenko Exp $
  + * @version CVS $Id: CocoonServlet.java,v 1.9 2002/02/13 09:35:35 froehlich Exp $
    */
   public class CocoonServlet extends HttpServlet {
   
  @@ -159,6 +159,8 @@
       private File uploadDir;
       private File workDir;
       private File cacheDir;
  +    private String containerEncoding;
  +    private String defaultFormEncoding;
   
       protected ServletContext servletContext;
       protected RepositoryClassLoader classLoader;
  @@ -363,6 +365,21 @@
               }
           }
   
  +        this.containerEncoding = conf.getInitParameter("container-encoding");
  +            if (containerEncoding == null) {
  +                containerEncoding = "ISO-8859-1";
  +            if (log.isDebugEnabled()) {
  +                log.debug("container-encoding was not set - defaulting to ISO-8859-1.");
  +            }
  +        }
  +
  +        this.defaultFormEncoding = conf.getInitParameter("form-encoding");
  +        if (defaultFormEncoding == null) {
  +            if (log.isDebugEnabled()) {
  +                log.debug("form-encoding was not set - defaulting to null.");
  +            }
  +        }
  +
           this.createCocoon();
       }
   
  @@ -1053,12 +1070,18 @@
       throws Exception {
           HttpEnvironment env;
   
  +        String formEncoding = req.getParameter("cocoon-form-encoding");
  +        if (formEncoding == null) {
  +            formEncoding = this.defaultFormEncoding;
  +        }
           env = new HttpEnvironment(uri,
                                     this.servletContextURL,
                                     req,
                                     res,
                                     this.servletContext,
  -                                  (HttpContext)this.appContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT));
  +                                  (HttpContext)this.appContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT),
  +                                  this.containerEncoding,
  +                                  formEncoding);
           env.setLogger(this.log);
           return env;
       }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message