You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ni...@apache.org on 2002/11/25 15:06:38 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/servlet CocoonServlet.java

nicolaken    2002/11/25 06:06:38

  Modified:    .        changes.xml
               src/java/org/apache/cocoon/servlet CocoonServlet.java
  Log:
    <action dev="NKB" type="fix" due-to="Hussayn Dabbous" due-to-email="dabbous@saxess.com">
      When a part of a pipeline aggregation fails, cocoon will no more silently return
      without reporting an error.
      Now, upon request of an erroneous page, the result is that I can see all parts, that have been processed so
      far on the screen and I see the error infos positioned at the bottom of the page.
    </action>
  
  Revision  Changes    Path
  1.286     +7 -1      xml-cocoon2/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/changes.xml,v
  retrieving revision 1.285
  retrieving revision 1.286
  diff -u -r1.285 -r1.286
  --- changes.xml	23 Nov 2002 14:16:03 -0000	1.285
  +++ changes.xml	25 Nov 2002 14:06:37 -0000	1.286
  @@ -40,6 +40,12 @@
    </devs>
   
    <release version="@version@" date="@date@">
  +  <action dev="NKB" type="fix" due-to="Hussayn Dabbous" due-to-email="dabbous@saxess.com">
  +    When a part of a pipeline aggregation fails, cocoon will no more silently return 
  +    without reporting an error.
  +    Now, upon request of an erroneous page, the result is that I can see all parts, that have been processed so
  +    far on the screen and I see the error infos positioned at the bottom of the page.
  +  </action> 
     <action dev="JQ" type="update">
      Added 'query' sitemap parameter to SearchTransformer. Added configuration parameters to 
      SimpleLuceneXMLIndexerImpl for choosing the content-view and which tags you want stored
  
  
  
  1.44      +44 -9     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.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- CocoonServlet.java	29 Oct 2002 05:29:18 -0000	1.43
  +++ CocoonServlet.java	25 Nov 2002 14:06:38 -0000	1.44
  @@ -1047,13 +1047,48 @@
   
           String contentType = null;
           ContextMap ctxMap = null;
  +        
  +        Environment env; 
  +        
  +        try{
  +            if (uri.charAt(0) == '/') {
  +                uri = uri.substring(1);
  +            }
  +                env = getEnvironment(URLDecoder.decode(uri), request, res);
  +                
  +        } catch (Exception e) {
  +            if (log.isErrorEnabled()) {
  +                log.error("Problem with Cocoon servlet", e);
  +            }
  +
  +            if (manageExceptions) {
  +                res.reset();
  +                
  +                HashMap extraDescriptions = new HashMap(3);
  +                extraDescriptions.put("request-uri", request.getRequestURI());
  +                extraDescriptions.put("path-info", uri);
  +                StringWriter writer = new StringWriter();
  +                e.printStackTrace(new PrintWriter(writer));
  +                extraDescriptions.put("stack-trace",writer.toString());
  +
  +                Notifying n=new DefaultNotifyingBuilder().build(
  +                this, e, "fatal","Problem in creating the Environment","Cocoon servlet",null,null,extraDescriptions);
  +
  +                res.setContentType("text/html");
  +                res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
  +                Notifier.notify(n, res.getOutputStream(), "text/html");
  +            } else {
  +                res.sendError
  +                (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  +                    "Internal server error.");
  +                res.flushBuffer();
  +            }
  +                return;
  +        }
  +            
  +        
           try {
               try {
  -                if (uri.charAt(0) == '/') {
  -                    uri = uri.substring(1);
  -                }
  -
  -                Environment env = getEnvironment(URLDecoder.decode(uri), request, res);
   
                   // Initialize a fresh log context containing the object model : it
                   // will be used by the CocoonLogFormatter
  @@ -1073,7 +1108,7 @@
                       log.fatalError("The Cocoon engine said it failed to process the request for an unknown reason.");
   
                       if(manageExceptions){
  -                        res.reset();
  +                        env.tryResetResponse();
   
                           SimpleNotifyingBean n = new SimpleNotifyingBean(this);
                           n.setType("error");
  @@ -1102,7 +1137,7 @@
                   }
   
                   if (manageExceptions) {
  -                    res.reset();
  +                    env.tryResetResponse();
   
                       SimpleNotifyingBean n = new SimpleNotifyingBean(this);
                       n.setType("resource-not-found");
  @@ -1138,7 +1173,7 @@
                   }
   
                   if (manageExceptions) {
  -                    res.reset();
  +                    env.tryResetResponse();
   
                       HashMap extraDescriptions = new HashMap(3);
                       extraDescriptions.put("request-uri", request.getRequestURI());
  
  
  

----------------------------------------------------------------------
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