tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets WebdavServlet.java
Date Wed, 04 Apr 2001 18:23:08 GMT
remm        01/04/04 11:23:08

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        WebdavServlet.java
  Log:
  - Fix thread safety problems with the WebDAV servlet. The problem was
    that the JAXP document builder was not thread safe. Now, a new instance
    will be created on each request.
    The problem was reported and fixed by Juergen Pill in Slide, but I forgot to
    backport the fix (sorry ...), and it was reported again by Max du Prel <mduprel at
leveld.de>
  
  Revision  Changes    Path
  1.14      +23 -13    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java
  
  Index: WebdavServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WebdavServlet.java	2001/03/06 02:27:44	1.13
  +++ WebdavServlet.java	2001/04/04 18:23:06	1.14
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
1.13 2001/03/06 02:27:44 remm Exp $
  - * $Revision: 1.13 $
  - * $Date: 2001/03/06 02:27:44 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/WebdavServlet.java,v
1.14 2001/04/04 18:23:06 remm Exp $
  + * $Revision: 1.14 $
  + * $Date: 2001/04/04 18:23:06 $
    *
    * ====================================================================
    *
  @@ -125,7 +125,7 @@
    * are handled by the DefaultServlet.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.13 $ $Date: 2001/03/06 02:27:44 $
  + * @version $Revision: 1.14 $ $Date: 2001/04/04 18:23:06 $
    */
   
   public class WebdavServlet
  @@ -215,9 +215,9 @@
   
   
       /**
  -     * JAXP Document builder.
  +     * JAXP Document builder factory.
        */
  -    private DocumentBuilder documentBuilder;
  +    private DocumentBuilderFactory documentBuilderFactory;
   
   
       /**
  @@ -275,13 +275,7 @@
   	    ;
   	}
           
  -        try {
  -            documentBuilder = 
  -                DocumentBuilderFactory.newInstance().newDocumentBuilder();
  -        } catch(ParserConfigurationException e) {
  -            throw new ServletException
  -                (sm.getString("webdavservlet.jaxpfailed"));
  -        }
  +        documentBuilderFactory = DocumentBuilderFactory.newInstance();
   
       }
   
  @@ -431,7 +425,15 @@
   
           Node propNode = null;
           
  +        DocumentBuilder documentBuilder = null;
           try {
  +            documentBuilder = documentBuilderFactory.newDocumentBuilder();
  +        } catch(ParserConfigurationException e) {
  +            throw new ServletException
  +                (sm.getString("webdavservlet.jaxpfailed"));
  +        }
  +        
  +        try {
               Document document = documentBuilder.parse
                   (new InputSource(req.getInputStream()));
               
  @@ -839,6 +841,14 @@
           int lockRequestType = LOCK_CREATION;
           
           Node lockInfoNode = null;
  +        
  +        DocumentBuilder documentBuilder = null;
  +        try {
  +            documentBuilder = documentBuilderFactory.newDocumentBuilder();
  +        } catch(ParserConfigurationException e) {
  +            throw new ServletException
  +                (sm.getString("webdavservlet.jaxpfailed"));
  +        }
           
           try {
               Document document = documentBuilder.parse(new InputSource
  
  
  

Mime
View raw message