portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/dispatcher JetspeedRequestDispatcher.java
Date Mon, 19 Jan 2004 22:03:25 GMT
weaver      2004/01/19 14:03:25

  Modified:    commons/src/java/org/apache/jetspeed/dispatcher
                        JetspeedRequestDispatcher.java
  Log:
  Throw illeagalArgumentException if the RequestDispacther is null
  
  Revision  Changes    Path
  1.3       +14 -12    jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/dispatcher/JetspeedRequestDispatcher.java
  
  Index: JetspeedRequestDispatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/dispatcher/JetspeedRequestDispatcher.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JetspeedRequestDispatcher.java	7 Aug 2003 20:35:30 -0000	1.2
  +++ JetspeedRequestDispatcher.java	19 Jan 2004 22:03:25 -0000	1.3
  @@ -81,6 +81,10 @@
   
       public JetspeedRequestDispatcher(RequestDispatcher requestDispatcher)
       {
  +    	if(requestDispatcher == null)
  +    	{
  +    		throw new IllegalArgumentException("RequestDispatcher cannot be null for JetspeedRequestDispatcher.");
  +    	}
           this.requestDispatcher = requestDispatcher;
       }
   
  @@ -97,11 +101,7 @@
               this.requestDispatcher.include(servletRequest, servletResponse);
   
           }
  -        catch (java.io.IOException e)
  -        {
  -            throw e;
  -        }
  -        catch (javax.servlet.ServletException e)
  +        catch (Exception e)
           {
               PrintWriter pw = null;
               if (servletResponse != null)
  @@ -117,25 +117,27 @@
               log.error(
                   "Begin: ******************************************* JetspeedRequestDispatcher
Failure Report******************************************");
               log.error("Cause: " + e.getMessage(), e);
  -            if (e.getRootCause() != null)
  +            if (e.getCause() != null)
               {
  -                log.error("Root Cause: " + e.getRootCause().getMessage(), e.getRootCause());
  +                log.error("Root Cause: " + e.getCause().getMessage(), e.getCause());
                   if (pw != null)
                   {
                       pw.write("<p>Root Cause: </p>");
  -                    pw.write("Message: " + e.getRootCause().getMessage() + " <br/>");
  -                    pw.write("Exception: " + e.getRootCause().getClass().getName() + "
<br/>");
  -                    writeStackTrace(e.getRootCause().getStackTrace(), pw);
  +                    pw.write("Message: " + e.getCause().getMessage() + " <br/>");
  +                    pw.write("Exception: " + e.getCause().getClass().getName() + " <br/>");
  +                    writeStackTrace(e.getCause().getStackTrace(), pw);
                   }
   
                   log.error(
                       "End: *******************************************JetspeedRequestDispatcher
Failure Report******************************************");
  -                throw new PortletException(e.getRootCause());
  +                pw.flush();
  +                throw new PortletException(e);
               }
               else
               {
                   log.error(
                       "End: *******************************************JetspeedRequestDispatcher
Failure Report******************************************");
  +				pw.flush();
                   throw new PortletException(e);
               }
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message