cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2005-02-25 Thread luehe
luehe   2005/02/25 09:32:31

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixed indentation prior to making changes
  
  Revision  ChangesPath
  1.63  +20 -20
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- PageContextImpl.java  22 Nov 2004 16:35:52 -  1.62
  +++ PageContextImpl.java  25 Feb 2005 17:32:31 -  1.63
  @@ -802,26 +802,26 @@
   ((HttpServletRequest) request).getRequestURI());
   request.setAttribute(javax.servlet.error.servlet_name,
config.getServletName());
  -try {
  -forward(errorPageURL);
  -} catch (IllegalStateException ise) {
  -include(errorPageURL);
  -}
  -
  -// The error page could be inside an include.
  -
  -Object newException = 
request.getAttribute(javax.servlet.error.exception);
  -
  -// t==null means the attribute was not set.
  -if( (newException!= null)  (newException==t) ) {
  -request.removeAttribute(javax.servlet.error.exception);
  -}
  -
  -// now clear the error code - to prevent double handling.
  -request.removeAttribute(javax.servlet.error.status_code);
  -request.removeAttribute(javax.servlet.error.request_uri);
  -request.removeAttribute(javax.servlet.error.status_code);
  -request.removeAttribute(javax.servlet.jsp.jspException);
  +try {
  +forward(errorPageURL);
  +} catch (IllegalStateException ise) {
  +include(errorPageURL);
  +}
  +
  +// The error page could be inside an include.
  +
  +Object newException = 
request.getAttribute(javax.servlet.error.exception);
  +
  +// t==null means the attribute was not set.
  +if( (newException!= null)  (newException==t) ) {
  +request.removeAttribute(javax.servlet.error.exception);
  +}
  +
  +// now clear the error code - to prevent double handling.
  +request.removeAttribute(javax.servlet.error.status_code);
  +request.removeAttribute(javax.servlet.error.request_uri);
  +request.removeAttribute(javax.servlet.error.status_code);
  +request.removeAttribute(javax.servlet.jsp.jspException);
   
   } else {
   // Otherwise throw the exception wrapped inside a 
ServletException.
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2005-02-25 Thread luehe
luehe   2005/02/25 09:45:59

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixed 31659 (Page context not fully populated for Exception if using 
app-wide error page)
  
  Revision  ChangesPath
  1.64  +7 -5  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- PageContextImpl.java  25 Feb 2005 17:32:31 -  1.63
  +++ PageContextImpl.java  25 Feb 2005 17:45:59 -  1.64
  @@ -559,26 +559,28 @@
   public ServletRequest getRequest() { return request; }
   public ServletResponse getResponse() { return response; }
   
  +
   /**
* Returns the exception associated with this page
* context, if any.
* p/
  - * Added wrapping for Throwables to avoid ClassCaseException:
  + * Added wrapping for Throwables to avoid ClassCastException:
* see Bugzilla 31171 for details.
*
* @return The Exception associated with this page context, if any.
*/
   public Exception getException() {
  -Throwable exc = (Throwable) request.getAttribute(EXCEPTION);
  +Throwable t = JspRuntimeLibrary.getThrowable(request);
   
   // Only wrap if needed
  -if((exc != null)  (! (exc instanceof Exception))) {
  -exc = new JspException(exc);
  +if((t != null)  (! (t instanceof Exception))) {
  +t = new JspException(t);
   }
   
  -return (Exception) exc;
  +return (Exception) t;
   }
   
  +
   public Object getPage() { return servlet; }
   
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2004-09-20 Thread yoavs
yoavs   2004/09/20 10:58:26

  Modified:webapps/docs changelog.xml
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Bugzilla 31171: wrap to avoid ClassCastException if necessary.
  
  Revision  ChangesPath
  1.111 +5 -0  jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- changelog.xml 20 Sep 2004 17:00:03 -  1.110
  +++ changelog.xml 20 Sep 2004 17:58:26 -  1.111
  @@ -57,6 +57,11 @@
 /subsection
   
 subsection name=Jasper
  +changelog
  +  fix
  +bug31171/bug: Wrap to avoid ClassCastException in PageContextImpl. 
(yoavs)
  +  /fix
  +/changelog
 /subsection
   
 subsection name=Cluster
  
  
  
  1.61  +21 -1 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- PageContextImpl.java  13 Apr 2004 22:55:50 -  1.60
  +++ PageContextImpl.java  20 Sep 2004 17:58:26 -  1.61
  @@ -557,7 +557,27 @@
   }
   public ServletRequest getRequest() { return request; }
   public ServletResponse getResponse() { return response; }
  -public Exception getException() { return 
(Exception)request.getAttribute(EXCEPTION); }
  +
  +/**
  + * Returns the exception associated with this page
  + * context, if any.
  + * p/
  + * Added wrapping for Throwables to avoid ClassCaseException:
  + * see Bugzilla 31171 for details.
  + *
  + * @return The Exception associated with this page context, if any.
  + */
  +public Exception getException() {
  +Throwable exc = (Throwable) request.getAttribute(EXCEPTION);
  +
  +// Only wrap if needed
  +if((exc != null)  (! (exc instanceof Exception))) {
  +exc = new JspException(exc);
  +}
  +
  +return (Exception) exc;
  +}
  +
   public Object getPage() { return servlet; }
   
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2004-09-20 Thread yoavs
yoavs   2004/09/20 11:07:22

  Modified:webapps/docs Tag: TOMCAT_5_0 changelog.xml
   jasper2/src/share/org/apache/jasper/runtime Tag: TOMCAT_5_0
PageContextImpl.java
  Log:
  Bugzilla 31171: wrap to avoid ClassCastException if necessary.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.70.2.37 +3 -0  jakarta-tomcat-catalina/webapps/docs/changelog.xml
  
  Index: changelog.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
  retrieving revision 1.70.2.36
  retrieving revision 1.70.2.37
  diff -u -r1.70.2.36 -r1.70.2.37
  --- changelog.xml 20 Sep 2004 16:39:28 -  1.70.2.36
  +++ changelog.xml 20 Sep 2004 18:07:21 -  1.70.2.37
  @@ -99,6 +99,9 @@
 fix
   bug30984/bug: Added compilerTargetVM option to Jasper. (yoavs)
 /fix
  +  fix 
  +bug31171/bug: Wrap to avoid ClassCastException in PageContextImpl. 
(yoavs) 
  +  /fix 
   /changelog
 /subsection
 subsection name=Coyote
  
  
  
  No   revision
  No   revision
  1.60.2.1  +21 -1 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.60
  retrieving revision 1.60.2.1
  diff -u -r1.60 -r1.60.2.1
  --- PageContextImpl.java  13 Apr 2004 22:55:50 -  1.60
  +++ PageContextImpl.java  20 Sep 2004 18:07:22 -  1.60.2.1
  @@ -557,7 +557,27 @@
   }
   public ServletRequest getRequest() { return request; }
   public ServletResponse getResponse() { return response; }
  -public Exception getException() { return 
(Exception)request.getAttribute(EXCEPTION); }
  +
  +/** 
  + * Returns the exception associated with this page 
  + * context, if any. 
  + * p/ 
  + * Added wrapping for Throwables to avoid ClassCaseException: 
  + * see Bugzilla 31171 for details. 
  + * 
  + * @return The Exception associated with this page context, if any. 
  + */ 
  +public Exception getException() { 
  +Throwable exc = (Throwable) request.getAttribute(EXCEPTION); 
  +
  +// Only wrap if needed 
  +if((exc != null)  (! (exc instanceof Exception))) { 
  +exc = new JspException(exc); 
  +} 
  +
  +return (Exception) exc; 
  +} 
  +
   public Object getPage() { return servlet; }
   
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2004-04-09 Thread markt
markt   2004/04/09 09:31:29

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixing indents prior to actually changing the code.
  
  Revision  ChangesPath
  1.58  +6 -7  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- PageContextImpl.java  17 Mar 2004 19:23:04 -  1.57
  +++ PageContextImpl.java  9 Apr 2004 16:31:29 -   1.58
  @@ -800,23 +800,22 @@
   request.removeAttribute(javax.servlet.jsp.jspException);
   
   } else {
  -
  -// Otherwise throw the exception wrapped inside a ServletException.
  +// Otherwise throw the exception wrapped inside a ServletException.
   // Set the exception as the root cause in the ServletException
   // to get a stack trace for the real problem
   if (t instanceof IOException) throw (IOException)t;
   if (t instanceof ServletException) throw (ServletException)t;
  -if (t instanceof RuntimeException) throw (RuntimeException)t;
  +if (t instanceof RuntimeException) throw (RuntimeException)t;
   
   Throwable rootCause = null;
  -if (t instanceof JspException) {
  -rootCause = ((JspException) t).getRootCause();
  +if (t instanceof JspException) {
  +rootCause = ((JspException) t).getRootCause();
   } else if (t instanceof ELException) {
  -rootCause = ((ELException) t).getRootCause();
  +rootCause = ((ELException) t).getRootCause();
   }
   
   if (rootCause != null) {
  -throw new ServletException(t.getMessage(), rootCause);
  +throw new ServletException(t.getMessage(), rootCause);
   }

   throw new ServletException(t);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2004-04-09 Thread markt
markt   2004/04/09 09:35:12

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Fix bug19049. Clarify error message when nesting exceptions.
  - Patch provided by Joseph Shraibman.
  
  Revision  ChangesPath
  1.59  +2 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- PageContextImpl.java  9 Apr 2004 16:31:29 -   1.58
  +++ PageContextImpl.java  9 Apr 2004 16:35:12 -   1.59
  @@ -815,7 +815,8 @@
   }
   
   if (rootCause != null) {
  -throw new ServletException(t.getMessage(), rootCause);
  +throw new ServletException(t.getClass().getName() + :  + 
  +   t.getMessage(), rootCause);
   }

   throw new ServletException(t);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2004-04-09 Thread markt
markt   2004/04/09 09:40:13

  Modified:jasper2/src/share/org/apache/jasper/runtime Tag:
tomcat_4_branch PageContextImpl.java
  Log:
  Fixing indents prior to actually changing the code.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.11.2.8  +10 -10
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11.2.7
  retrieving revision 1.11.2.8
  diff -u -r1.11.2.7 -r1.11.2.8
  --- PageContextImpl.java  29 Feb 2004 19:07:26 -  1.11.2.7
  +++ PageContextImpl.java  9 Apr 2004 16:40:13 -   1.11.2.8
  @@ -524,12 +524,12 @@
   request.removeAttribute(javax.servlet.error.status_code);
   request.removeAttribute(javax.servlet.jsp.jspException);
   
  - } else {
  + } else {
   // Otherwise throw the exception wrapped inside a ServletException.
  - // Set the exception as the root cause in the ServletException
  - // to get a stack trace for the real problem
  - if (t instanceof IOException) throw (IOException)t;
  - if (t instanceof ServletException) throw (ServletException)t;
  + // Set the exception as the root cause in the ServletException
  + // to get a stack trace for the real problem
  + if (t instanceof IOException) throw (IOException)t;
  + if (t instanceof ServletException) throw (ServletException)t;
   if (t instanceof RuntimeException) throw (RuntimeException)t;
   if (t instanceof JspException) {
   Throwable rootCause = ((JspException)t).getRootCause();
  @@ -539,8 +539,8 @@
   throw new ServletException(t);
   }
   }
  - throw new ServletException(t);
  - }
  + throw new ServletException(t);
  + }
   }
   
   protected JspWriterImpl _createOut(int bufferSize, boolean autoFlush)
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2004-04-09 Thread markt
markt   2004/04/09 09:42:29

  Modified:jasper2/src/share/org/apache/jasper/runtime Tag:
tomcat_4_branch PageContextImpl.java
  Log:
  - Fix bug19049. Clarify error message when nesting exceptions.
  - Patch provided by Joseph Shraibman.
  - Ported from TC5.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.11.2.9  +5 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11.2.8
  retrieving revision 1.11.2.9
  diff -u -r1.11.2.8 -r1.11.2.9
  --- PageContextImpl.java  9 Apr 2004 16:40:13 -   1.11.2.8
  +++ PageContextImpl.java  9 Apr 2004 16:42:29 -   1.11.2.9
  @@ -534,7 +534,8 @@
   if (t instanceof JspException) {
   Throwable rootCause = ((JspException)t).getRootCause();
   if (rootCause != null) {
  -throw new ServletException(t.getMessage(), rootCause);
  +throw new ServletException(t.getClass().getName() + :  +
  +   t.getMessage(), rootCause);
   } else {
   throw new ServletException(t);
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2004-02-29 Thread markt
markt   2004/02/29 11:07:26

  Modified:jasper2/src/share/org/apache/jasper/runtime Tag:
tomcat_4_branch PageContextImpl.java
  Log:
  Fix bug 15754. PageContext.setAttribute() should throw a NPE if name or object are 
null.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.11.2.7  +32 -24
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11.2.6
  retrieving revision 1.11.2.7
  diff -u -r1.11.2.6 -r1.11.2.7
  --- PageContextImpl.java  5 Feb 2004 22:19:08 -   1.11.2.6
  +++ PageContextImpl.java  29 Feb 2004 19:07:26 -  1.11.2.7
  @@ -229,33 +229,41 @@
   
   
   public void setAttribute(String name, Object attribute) {
  - attributes.put(name, attribute);
  +setAttribute(name, attribute, PAGE_SCOPE);
   }
   
  -
   public void setAttribute(String name, Object o, int scope) {
  - switch (scope) {
  - case PAGE_SCOPE:
  - attributes.put(name, o);
  - break;
  -
  - case REQUEST_SCOPE:
  - request.setAttribute(name, o);
  - break;
  -
  - case SESSION_SCOPE:
  - if (session == null)
  - throw new IllegalArgumentException(can't access SESSION_SCOPE 
without an HttpSession);
  - else
  - session.setAttribute(name, o);
  - break;
  -
  - case APPLICATION_SCOPE:
  - context.setAttribute(name, o);
  - break;
  +if (name == null) {
  +throw new NullPointerException(name may not be null);
  +}
  +
  +if (o == null) {
  +throw new NullPointerException(object may not be null);
  +}
  +
  +switch (scope) {
  +case PAGE_SCOPE:
  +attributes.put(name, o);
  +break;
  +
  +case REQUEST_SCOPE:
  +request.setAttribute(name, o);
  +break;
  +
  +case SESSION_SCOPE:
  +if (session == null)
  +throw new IllegalArgumentException
  +(can't access SESSION_SCOPE without an HttpSession);
  +else
  +session.setAttribute(name, o);
  +break;
  +
  +case APPLICATION_SCOPE:
  +context.setAttribute(name, o);
  +break;
   
  - default:
  - }
  +default:
  +}
   }
   
   public void removeAttribute(String name, int scope) {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2003-10-01 Thread luehe
luehe   2003/10/01 09:15:33

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixed indentation
  
  Revision  ChangesPath
  1.55  +16 -16
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- PageContextImpl.java  19 Sep 2003 21:24:47 -  1.54
  +++ PageContextImpl.java  1 Oct 2003 16:15:33 -   1.55
  @@ -692,24 +692,24 @@
   // Make sure that the response object is not the wrapper for include
   while (response instanceof ServletResponseWrapperInclude) {
   response = ((ServletResponseWrapperInclude)response).getResponse();
  -}
  +}
   
  -final String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  -String includeUri
  -= (String) request.getAttribute(Constants.INC_SERVLET_PATH);
  +final String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  +String includeUri
  += (String) request.getAttribute(Constants.INC_SERVLET_PATH);
   
  -final ServletResponse fresponse = response;
  -final ServletRequest frequest = request;
  +final ServletResponse fresponse = response;
  +final ServletRequest frequest = request;
   
  +if (includeUri != null)
  +request.removeAttribute(Constants.INC_SERVLET_PATH);
  +try {
  +context.getRequestDispatcher(path).forward(request, response);
  +} finally {
   if (includeUri != null)
  -request.removeAttribute(Constants.INC_SERVLET_PATH);
  -try {
  -context.getRequestDispatcher(path).forward(request, response);
  -} finally {
  -if (includeUri != null)
  -request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
  +request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
   request.setAttribute(Constants.FORWARD_SEEN, true);
  -}
  +}
   }
   
   public BodyContent pushBody() {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2003-08-04 Thread remm
remm2003/08/04 05:26:33

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Enable expression cache, submitted by Matthias Ernst. Bug 22090.
  
  Revision  ChangesPath
  1.51  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- PageContextImpl.java  11 Jul 2003 01:29:14 -  1.50
  +++ PageContextImpl.java  4 Aug 2003 12:26:33 -   1.51
  @@ -121,7 +121,7 @@
   
   // The expression evaluator, for evaluating EL expressions.
   private static ExpressionEvaluatorImpl elExprEval
  - = new ExpressionEvaluatorImpl(true);
  + = new ExpressionEvaluatorImpl(false);
   
   // The variable resolver, for evaluating EL expressions.
   private VariableResolverImpl variableResolver;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2003-07-10 Thread luehe
luehe   2003/07/10 18:29:14

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  cleanup
  
  Revision  ChangesPath
  1.50  +4 -16 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- PageContextImpl.java  17 May 2003 00:14:10 -  1.49
  +++ PageContextImpl.java  11 Jul 2003 01:29:14 -  1.50
  @@ -205,15 +205,12 @@
   // initialize the initial out ...
   depth = -1;
   if (this.baseOut == null) {
  -this.baseOut = _createOut(bufferSize, autoFlush);
  +this.baseOut = new JspWriterImpl(response, bufferSize, autoFlush);
   } else {
   this.baseOut.init(response, bufferSize, autoFlush);
   }
   this.out = baseOut;
   
  - if (this.out == null)
  - throw new IllegalStateException(failed initialize JspWriter);
  -
// register names/values as per spec
setAttribute(OUT, this.out);
setAttribute(REQUEST, request);
  @@ -768,13 +765,4 @@
return retValue;
   }
   
  -private JspWriterImpl _createOut(int bufferSize, boolean autoFlush)
  -throws IOException {
  -try {
  -return new JspWriterImpl(response, bufferSize, autoFlush);
  -} catch( Throwable t ) {
  -log.warn(creating out, t);
  -return null;
  -}
  -}
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2003-03-03 Thread jfarcand
jfarcand2003/03/03 07:56:26

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Add missing AccesController.doPrivileged block.
  
  Revision  ChangesPath
  1.45  +22 -5 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- PageContextImpl.java  15 Feb 2003 00:24:22 -  1.44
  +++ PageContextImpl.java  3 Mar 2003 15:56:26 -   1.45
  @@ -63,6 +63,7 @@
   
   import java.io.*;
   import java.security.AccessController;
  +import java.security.PrivilegedAction;
   import java.security.PrivilegedExceptionAction;
   import java.security.PrivilegedActionException;
   import java.util.EmptyStackException;
  @@ -541,13 +542,29 @@
response = ((ServletResponseWrapperInclude)response).getResponse();
   }
   
  -String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  +final String path = getAbsolutePathRelativeToContext(relativeUrlPath);
   String includeUri
   = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
  +
  +final ServletResponse fresponse = response;
  +final ServletRequest frequest = request;
  +
   if (includeUri != null)
   request.removeAttribute(Constants.INC_SERVLET_PATH);
   try {
  -context.getRequestDispatcher(path).forward(request, response);
  +if (System.getSecurityManager() != null){
  +AccessController.doPrivileged(new PrivilegedExceptionAction(){  
  
  +public Object run() throws ServletException, IOException{
  +context.getRequestDispatcher(path).forward(frequest, 
  +   fresponse);
  +return (null);
  +}
  +});
  +} else {
  +context.getRequestDispatcher(path).forward(request, response);
  +} 
  +} catch(PrivilegedActionException e){
  +;
   } finally {
   if (includeUri != null)
   request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2003-02-07 Thread luehe
luehe   2003/02/07 16:59:32

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Cleanup:
  - Removed unnecessary class casts
  - Added localizable error code for attempt to access session scope in page that
does not participate in any session
  
  Revision  ChangesPath
  1.41  +170 -192  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- PageContextImpl.java  4 Feb 2003 23:38:46 -   1.40
  +++ PageContextImpl.java  8 Feb 2003 00:59:31 -   1.41
  @@ -111,60 +111,92 @@
* @author Hans Bergsten
* @author Pierre Delisle
* @author Mark Roth
  + * @author Jan Luehe
*/
   public class PageContextImpl extends PageContext implements VariableResolver {
   
   // Logger
   private static Log log = LogFactory.getLog(PageContextImpl.class);
   
  -/**
  - * The expression evaluator, for evaluating EL expressions.
  - */
  -private static ExpressionEvaluatorImpl expressionEvaluator
  +// The expression evaluator, for evaluating EL expressions.
  +private static ExpressionEvaluatorImpl elExprEval
= new ExpressionEvaluatorImpl();
   
  -/**
  - * The variable resolver, for evaluating EL expressions.
  - */
  -private VariableResolverImpl variableResolver
  - = new VariableResolverImpl(this);
  +// The variable resolver, for evaluating EL expressions.
  +private VariableResolverImpl variableResolver;
   
  -PageContextImpl(JspFactory factory) {
  -this.factory = factory;
  -}
  +private BodyContentImpl[] outs;
  +private int depth;
   
  -public void initialize(Servlet servlet, ServletRequest request,
  -   ServletResponse response, String errorPageURL,
  -   boolean needsSession, int bufferSize,
  -   boolean autoFlush)
  -throws IOException, IllegalStateException, IllegalArgumentException
  -{
  - _initialize(servlet, request, response, errorPageURL, needsSession, 
bufferSize, autoFlush);
  -}
  +// per-servlet state
  +private Servlet servlet;
  +private ServletConfig config;
  +private ServletContext context;
  +private JspFactory factory;
  +private boolean needsSession;
  +private String errorPageURL;
  +private boolean autoFlush;
  +private int  bufferSize;
  +
  +// page-scope attributes
  +private transient Hashtable  attributes;
  +
  +// per-request state
  +private transient ServletRequest request;
  +private transient ServletResponse response;
  +private transient Object page;
  +private transient HttpSession session;
  +private boolean isIncluded;
   
  -private void _initialize(Servlet servlet, ServletRequest request,
  -   ServletResponse response, String errorPageURL,
  -   boolean needsSession, int bufferSize,
  -   boolean autoFlush)
  -throws IOException, IllegalStateException, IllegalArgumentException
  -{
  +// initial output stream
  +private transient JspWriter out;
  +private transient JspWriterImpl baseOut;
   
  - // initialize state
  +/*
  + * Constructor.
  + */
  +PageContextImpl(JspFactory factory) {
  +this.factory = factory;
  + this.variableResolver = new VariableResolverImpl(this);
  + this.outs = new BodyContentImpl[0];
  + this.attributes = new Hashtable(16);
  + this.depth = -1;
  +}
  +
  +public void initialize(Servlet servlet,
  +ServletRequest request,
  +   ServletResponse response,
  +String errorPageURL,
  +   boolean needsSession,
  +int bufferSize,
  +   boolean autoFlush) throws IOException {
  +
  + _initialize(servlet, request, response, errorPageURL, needsSession,
  + bufferSize, autoFlush);
  +}
  +
  +private void _initialize(Servlet servlet,
  +  ServletRequest request,
  +  ServletResponse response,
  +  String errorPageURL,
  +  boolean needsSession,
  +  int bufferSize,
  +  boolean autoFlush) throws IOException {
   
  - this.servlet  = servlet;
  - this.config   = servlet.getServletConfig();
  - this.context  = config.getServletContext();
  + // initialize state
  + 

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java ProtectedFunctionMapper.java ExpressionEvaluatorImpl.java

2003-02-04 Thread luehe
luehe   2003/02/04 15:38:46

  Modified:jasper2/src/share/org/apache/jasper/compiler JspUtil.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java ProtectedFunctionMapper.java
  Removed: jasper2/src/share/org/apache/jasper/runtime
ExpressionEvaluatorImpl.java
  Log:
  Integrated commons-el
  
  Revision  ChangesPath
  1.30  +6 -7  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- JspUtil.java  3 Feb 2003 20:11:41 -   1.29
  +++ JspUtil.java  4 Feb 2003 23:38:46 -   1.30
  @@ -79,11 +79,10 @@
   import org.xml.sax.Attributes;
   
   // EL interpreter (subject to change)
  -import javax.servlet.jsp.el.ExpressionEvaluator;
   import javax.servlet.jsp.el.FunctionMapper;
   import javax.servlet.jsp.el.ELException;
   import javax.servlet.jsp.el.ELParseException;
  -import org.apache.jasper.runtime.ExpressionEvaluatorImpl;
  +import org.apache.commons.el.ExpressionEvaluatorImpl;
   
   /** 
* This class has all the utility method(s).
  @@ -108,8 +107,8 @@
   private static final String CLOSE_EXPR_XML = %;
   
   private static int tempSequenceNumber = 0;
  -private static ExpressionEvaluatorImpl expressionEvaluator = 
  -new ExpressionEvaluatorImpl( null );
  +private static ExpressionEvaluatorImpl expressionEvaluator
  + = new ExpressionEvaluatorImpl();
   
   public static char[] removeQuotes(char []chars) {
CharArrayWriter caw = new CharArrayWriter();
  
  
  
  1.40  +32 -52
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- PageContextImpl.java  22 Jan 2003 20:08:25 -  1.39
  +++ PageContextImpl.java  4 Feb 2003 23:38:46 -   1.40
  @@ -95,7 +95,10 @@
   
   import org.apache.jasper.Constants;
   import org.apache.jasper.compiler.Localizer;
  -import org.apache.jasper.runtime.el.jstl.JSTLVariableResolver;
  +
  +import org.apache.commons.el.VariableResolverImpl;
  +import org.apache.commons.el.ExpressionEvaluatorImpl;
  +
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -117,22 +120,14 @@
   /**
* The expression evaluator, for evaluating EL expressions.
*/
  -private ExpressionEvaluatorImpl expressionEvaluator = null;
  +private static ExpressionEvaluatorImpl expressionEvaluator
  + = new ExpressionEvaluatorImpl();
   
   /**
* The variable resolver, for evaluating EL expressions.
*/
  -private static JSTLVariableResolver variableResolver =
  -new JSTLVariableResolver();
  -
  -/**
  - * Expression evaluator for proprietary EL evaluation.
  - * XXX - This should be going away once the EL evaluator moves from
  - * the JSTL implementation to its own project.
  - */
  -private static org.apache.jasper.runtime.el.jstl.Evaluator
  -proprietaryEvaluator = new
  -org.apache.jasper.runtime.el.jstl.Evaluator();
  +private VariableResolverImpl variableResolver
  + = new VariableResolverImpl(this);
   
   PageContextImpl(JspFactory factory) {
   this.factory = factory;
  @@ -558,13 +553,7 @@
* ExpressionEvaluator that can parse EL expressions.
*/
   public ExpressionEvaluator getExpressionEvaluator() {
  -if( this.expressionEvaluator == null ) {
  -this.expressionEvaluator = new ExpressionEvaluatorImpl( this );
  -// no need to synchronize - not a big deal even if we create
  -// two of these.
  -}
  -
  -return this.expressionEvaluator;
  +return expressionEvaluator;
   }
   
   public void handlePageException(Exception ex)
  @@ -640,16 +629,8 @@
   /**
* VariableResolver interface
*/
  -public Object resolveVariable( String pName )
  -throws ELException
  -{
  -try {
  -return PageContextImpl.variableResolver.resolveVariable( pName, 
  -this );
  -}
  -catch( org.apache.jasper.runtime.el.jstl.ELException e ) {
  -throw new ELException( e );
  -}
  +public Object resolveVariable(String pName) throws ELException {
  + return variableResolver.resolveVariable(pName);
   }
   
   private static 

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2003-01-14 Thread luehe
luehe   2003/01/14 16:20:46

  Modified:jasper2/src/share/org/apache/jasper/compiler Tag:
tomcat_4_branch Generator.java
   jasper2/src/share/org/apache/jasper/runtime Tag:
tomcat_4_branch PageContextImpl.java
  Log:
  Fixed 15105: pushBody()/popBody() error on tomcat 4.1.X
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.35.2.15 +3 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.35.2.14
  retrieving revision 1.35.2.15
  diff -u -r1.35.2.14 -r1.35.2.15
  --- Generator.java8 Jan 2003 22:24:28 -   1.35.2.14
  +++ Generator.java15 Jan 2003 00:20:46 -  1.35.2.15
  @@ -1368,7 +1368,6 @@
// Assume EVAL_BODY_BUFFERED
out.pushIndent();
out.printil(javax.servlet.jsp.tagext.BodyContent _bc = 
pageContext.pushBody(););
  - out.printil(_bc.clear(););
out.printil(out = _bc;);
   
out.printin(tagHandlerVar);
  
  
  
  No   revision
  
  
  No   revision
  
  
  1.11.2.5  +6 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11.2.4
  retrieving revision 1.11.2.5
  diff -u -r1.11.2.4 -r1.11.2.5
  --- PageContextImpl.java  8 Nov 2002 14:56:44 -   1.11.2.4
  +++ PageContextImpl.java  15 Jan 2003 00:20:46 -  1.11.2.5
  @@ -448,7 +448,10 @@
   newOuts[depth] = new BodyContentImpl(out);
   outs = newOuts;
   }
  +
  + outs[depth].clearBody();
   out = outs[depth];
  +
   return outs[depth];
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-12-02 Thread luehe
luehe   2002/12/02 17:58:36

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixed Bugtraq 4787293: JspContext.popBody and Jsp/PageContext.pushBody don't
 update out attribute
  
  Revision  ChangesPath
  1.37  +12 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- PageContextImpl.java  27 Nov 2002 02:31:29 -  1.36
  +++ PageContextImpl.java  3 Dec 2002 01:58:36 -   1.37
  @@ -530,6 +530,10 @@
outs[depth].setWriter(writer);
   out = outs[depth];
   
  + // Update the value of the out attribute in the page scope
  + // attribute namespace of this PageContext
  + setAttribute(OUT, out);
  +
   return outs[depth];
   }
   
  @@ -540,6 +544,11 @@
   } else {
   out = baseOut;
   }
  +
  + // Update the value of the out attribute in the page scope
  + // attribute namespace of this PageContext
  + setAttribute(OUT, out);
  +
   return out;
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-26 Thread kinman
kinman  2002/11/26 18:31:29

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
JspUtil.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Do XML escape on EL results if they are in template texts.
  
  Revision  ChangesPath
  1.132 +6 -6  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.131
  retrieving revision 1.132
  diff -u -r1.131 -r1.132
  --- Generator.java26 Nov 2002 01:25:29 -  1.131
  +++ Generator.java27 Nov 2002 02:31:29 -  1.132
  @@ -764,7 +764,7 @@
if (attr.isELInterpreterInput()) {
v = JspUtil.interpreterCall(this.isTagFile,
attr.getValue(), expectedType, defaultPrefix,
  - _jspx_fnmap );
  + _jspx_fnmap, false );
}
if (encode) {
return java.net.URLEncoder.encode(\\ +  + v + );
  @@ -843,7 +843,7 @@
   out.write(
+ JspUtil.interpreterCall(this.isTagFile,
   ${ + new String(n.getText()) + }, String.class,
  - null, _jspx_fnmap )
  + null, _jspx_fnmap, true )
   + ););
   } else {
   out.printil(out.write( +
  @@ -2436,7 +2436,7 @@
} else if (attrs[i].isELInterpreterInput()) {
   // run attrValue through the expression interpreter
   attrValue = JspUtil.interpreterCall(this.isTagFile,
  -attrValue, c[0], n.getPrefix(), _jspx_fnmap );
  +attrValue, c[0], n.getPrefix(), _jspx_fnmap, false );
   } else {
attrValue = convertString(
   c[0], attrValue, attrName,
  
  
  
  1.22  +7 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java
  
  Index: JspUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/JspUtil.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JspUtil.java  6 Nov 2002 20:14:19 -   1.21
  +++ JspUtil.java  27 Nov 2002 02:31:29 -  1.22
  @@ -470,13 +470,15 @@
* @param expectedType the expected type of the interpreted result
* @param defaultPrefix Default prefix, or literal null
* @param fnmapvar Variable pointing to a function map.
  + * @param XmlEscape True if the result should do XML escaping
* @return a String representing a call to the EL interpreter.
*/
   public static String interpreterCall(boolean isTagFile,
 String expression,
Class expectedType,
String defaultPrefix,
  - String fnmapvar ) 
  + String fnmapvar,
  + boolean XmlEscape ) 
   {
   /*
* Determine which context object to use.
  @@ -545,6 +547,7 @@
  +   ,  + fnmapvar + , 
  +   ((defaultPrefix == null) ? 
   null : Generator.quote( defaultPrefix )) 
  ++ ,  + XmlEscape
  + ));

/*
  
  
  
  1.36  +36 -6 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- PageContextImpl.java  8 Nov 2002 19:11:26 -   1.35
  +++ PageContextImpl.java  27 Nov 2002 02:31:29 -  1.36
  @@ -644,6 +644,28 @@
   }
   }
   
  +private static String XmlEscape(String s) {
  +if (s == null) return null;
  +StringBuffer sb = new StringBuffer();
  +for(int i = 0; i  s.length(); i++) {
  +char c = s.charAt(i);
  +if (c == '') {
  +sb.append(lt;);
  +} else if (c == '') {
  +sb.append(gt;);
  +} else if (c == '\'') {
  +sb.append(#039;); // apos;
  +} else if (c == '') {
  +sb.append(amp;);
  +} 

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-08 Thread remm
remm2002/11/08 06:56:44

  Modified:jasper2/src/share/org/apache/jasper/runtime Tag:
tomcat_4_branch PageContextImpl.java
  Log:
  - Port revised non flushing patch.
  - It appears not to be causing problems during my testing. If it does, the patch
should be reverted.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.11.2.4  +42 -6 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11.2.3
  retrieving revision 1.11.2.4
  diff -u -r1.11.2.3 -r1.11.2.4
  --- PageContextImpl.java  6 Nov 2002 15:38:44 -   1.11.2.3
  +++ PageContextImpl.java  8 Nov 2002 14:56:44 -   1.11.2.4
   -176,10 +176,13 
try {
if (isIncluded) {
((JspWriterImpl)out).flushBuffer();
  - // push it into the including jspWriter
  +// push it into the including jspWriter
} else {
  - out.flush();
  - }
  +// Do not flush the buffer even if we're not included (i.e.
  +// we are the main page. The servlet will flush it and close
  +// the stream.
  +((JspWriterImpl)out).flushBuffer();
  +}
} catch (IOException ex) {
loghelper.log(Internal error flushing the buffer in release());
}
   -470,15 +473,48 
   public void handlePageException(Throwable t)
   throws IOException, ServletException 
   {
  + if (t == null) throw new NullPointerException(null Throwable);
   // set the request attribute with the Throwable.
  +
request.setAttribute(javax.servlet.jsp.jspException, t);
   
if (errorPageURL != null  !errorPageURL.equals()) {
  +
  + // Set request attributes.
  + // Do not set the javax.servlet.error.exception attribute here
  + // (instead, set in the generated servlet code for the error page)
  + // in order to prevent the ErrorReportValve, which is invoked as
  + // part of forwarding the request to the error page, from
  + // throwing it if the response has not been committed (the response
  + // will have been committed if the error page is a JSP page).
  + request.setAttribute(javax.servlet.error.status_code,
  + new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
  + request.setAttribute(javax.servlet.error.request_uri,
  + ((HttpServletRequest) request).getRequestURI());
  + request.setAttribute(javax.servlet.error.servlet_name,
  +  config.getServletName());
  +
   try {
   forward(errorPageURL);
   } catch (IllegalStateException ise) {
   include(errorPageURL);
   }
  +
  +// The error page could be inside an include.
  +
  +Object 
newException=request.getAttribute(javax.servlet.error.exception);
  +
  +// t==null means the attribute was not set.
  +if ( (newException!= null)  (newException==t) ) {
  +request.removeAttribute(javax.servlet.error.exception);
  +}
  +
  +// now clear the error code - to prevent double handling.
  +request.removeAttribute(javax.servlet.error.status_code);
  +request.removeAttribute(javax.servlet.error.request_uri);
  +request.removeAttribute(javax.servlet.error.status_code);
  +request.removeAttribute(javax.servlet.jsp.jspException);
  +
} else {
   // Otherwise throw the exception wrapped inside a ServletException.
// Set the exception as the root cause in the ServletException
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-08 Thread luehe
luehe   2002/11/08 11:11:26

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Made enumeration of ValidationMessage[] returned by TLV's validate()
  method more robust by also considering the case where a
  ValidationMessage element might be null.
  
  Revision  ChangesPath
  1.35  +20 -9 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- PageContextImpl.java  7 Nov 2002 23:33:38 -   1.34
  +++ PageContextImpl.java  8 Nov 2002 19:11:26 -   1.35
   -274,19 +274,26 
   
   public void setAttribute(String name, Object attribute) {
   
  - if (name == null || attribute == null)
  - throw new NullPointerException(Null name or attribute value);
  -
  - attributes.put(name, attribute);
  + if (name == null) {
  + throw new NullPointerException(Null name);
  + }
  +
  + if (attribute != null) {
  + attributes.put(name, attribute);
  + } else {
  + removeAttribute(name, PAGE_SCOPE);
  + }
   }
   
   
   public void setAttribute(String name, Object o, int scope) {
   
  - if (name == null || o == null)
  - throw new NullPointerException(Null name or attribute value);
  + if (name == null) {
  + throw new NullPointerException(Null name);
  + }
   
  - switch (scope) {
  + if (o != null) {
  + switch (scope) {
case PAGE_SCOPE:
attributes.put(name, o);
break;
   -309,6 +316,10 
   
default:
throw new IllegalArgumentException(Invalid scope);
  + } // switch
  +
  + } else {
  + removeAttribute(name, scope);
}
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-07 Thread remm
remm2002/11/07 02:51:15

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Fix Watchdog failures.
  
  Revision  ChangesPath
  1.32  +6 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- PageContextImpl.java  7 Nov 2002 00:49:53 -   1.31
  +++ PageContextImpl.java  7 Nov 2002 10:51:14 -   1.32
   -581,11 +581,13 
   } catch (IllegalStateException ise) {
   include(errorPageURL);
   }
  +
   // The error page could be inside an include.
   
   Object 
newException=request.getAttribute(javax.servlet.error.exception);
   
  -if( (newException!= null)  (newException==origException) ) {
  +if ((origException == null) || 
  +((newException != null)  (newException == origException))) {
   request.removeAttribute(javax.servlet.error.exception);
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java ProtectedFunctionMapper.java HttpJspBase.java

2002-11-07 Thread jfarcand
jfarcand2002/11/07 13:11:40

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java ProtectedFunctionMapper.java
HttpJspBase.java
  Log:
  Securize the package so it can work under the SecurityManager when the 
org.apache.jasper is protected. Fix bugs when the JSP 2.0 examples were executed under 
the SecurityManager.
  
  Revision  ChangesPath
  1.33  +33 -16
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- PageContextImpl.java  7 Nov 2002 10:51:14 -   1.32
  +++ PageContextImpl.java  7 Nov 2002 21:11:40 -   1.33
   -62,7 +62,9 
   package org.apache.jasper.runtime;
   
   import java.io.*;
  -
  +import java.security.AccessController;
  +import java.security.PrivilegedExceptionAction;
  +import java.security.PrivilegedActionException;
   import java.util.EmptyStackException;
   import java.util.Enumeration;
   import java.util.Hashtable;
   -645,21 +647,36 
* param defaultPrefix Default prefix for this evaluation
* return The result of the evaluation
*/
  -public static Object proprietaryEvaluate( String expression,
  -Class expectedType, PageContext pageContext,
  - ProtectedFunctionMapper functionMap, String defaultPrefix )
  -throws ELException
  +public static Object proprietaryEvaluate( final String expression, 
  + final Class expectedType,  final PageContext pageContext,
  +  final ProtectedFunctionMapper functionMap,  final String defaultPrefix )
  +   throws ELException
   {
  - java.util.HashMap funcMap =
  + final java.util.HashMap funcMap =
(functionMap == null)? null: functionMap.getFnMap();
  +
  +if (System.getSecurityManager() != null){
  +try {
  +return AccessController.doPrivileged(new 
PrivilegedExceptionAction(){
   
  -try {
  -return PageContextImpl.proprietaryEvaluator.evaluate( unknown,
  -expression, expectedType, null, pageContext,
  - funcMap, defaultPrefix );
  -}
  -catch( JspException e ) {
  -throw new ELException( e );
  +public Object run() throws Exception{
  +   return PageContextImpl.proprietaryEvaluator.evaluate( 
unknown, 
  +expression, expectedType, null, pageContext,
  +funcMap, defaultPrefix );
  +}
  +});
  +} catch( PrivilegedActionException ex ) {
  +Exception e = ex.getException();
  +throw new ELException( e );
  +}
  +} else {
  +try{
  +   return PageContextImpl.proprietaryEvaluator.evaluate( unknown, 
  +expression, expectedType, null, pageContext,
  +funcMap, defaultPrefix );
  +} catch(JspException e){
  +throw new ELException( e );
  +}  
   }
   }
   
  
  
  
  1.2   +25 -10
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/ProtectedFunctionMapper.java
  
  Index: ProtectedFunctionMapper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/ProtectedFunctionMapper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProtectedFunctionMapper.java  6 Nov 2002 18:48:17 -   1.1
  +++ ProtectedFunctionMapper.java  7 Nov 2002 21:11:40 -   1.2
   -65,7 +65,8 
   import java.util.HashMap;
   import java.security.AccessController;
   import java.security.PrivilegedAction;
  -
  +import java.security.PrivilegedExceptionAction;
  +import java.security.PrivilegedActionException;
   /**
* Maps EL functions to their Java method counterparts.  Keeps the
* actual Method objects protected so that JSP pages can't indirectly
   -125,14 +126,28 
* could be found.
*/
   public void mapFunction( String prefix, String fnName,
  -Class c, String methodName, Class[] args ) 
  +final Class c, final String methodName, final Class[] args ) 
   {
java.lang.reflect.Method method;
  - try {
  - method = c.getDeclaredMethod(methodName, args);
  - } catch( NoSuchMethodException e ) {
  -throw new RuntimeException(
  -Invalid function mapping - no such method:  + e.getMessage());
  +if 

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-07 Thread costin
costin  2002/11/07 15:33:39

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Thanks for the fix. I added the test for newException!=oldException
  after testing, just before commit.
  
  The oldException is allways null, since the attribute is set later.
  Now it should be ok, and deal with errors in the error page.
  
  Revision  ChangesPath
  1.34  +5 -6  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- PageContextImpl.java  7 Nov 2002 21:11:40 -   1.33
  +++ PageContextImpl.java  7 Nov 2002 23:33:38 -   1.34
   -569,7 +569,6 
// part of forwarding the request to the error page, from
// throwing it if the response has not been committed (the response
// will have been committed if the error page is a JSP page).
  -Object 
origException=request.getAttribute(javax.servlet.error.exception);
   
request.setAttribute(javax.servlet.jsp.jspException, t);
request.setAttribute(javax.servlet.error.status_code,
   -588,8 +587,8 
   
   Object 
newException=request.getAttribute(javax.servlet.error.exception);
   
  -if ((origException == null) || 
  -((newException != null)  (newException == origException))) {
  +// t==null means the attribute was not set.
  +if( (newException!= null)  (newException==t) ) {
   request.removeAttribute(javax.servlet.error.exception);
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-06 Thread costin
costin  2002/11/06 07:38:45

  Modified:jasper2/src/share/org/apache/jasper/runtime Tag:
tomcat_4_branch PageContextImpl.java
  Log:
  Revert the flush-in-release patch for 4.1 tree.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.11.2.3  +1 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11.2.2
  retrieving revision 1.11.2.3
  diff -u -r1.11.2.2 -r1.11.2.3
  --- PageContextImpl.java  29 Oct 2002 22:29:05 -  1.11.2.2
  +++ PageContextImpl.java  6 Nov 2002 15:38:44 -   1.11.2.3
   -178,10 +178,7 
((JspWriterImpl)out).flushBuffer();
// push it into the including jspWriter
} else {
  - //out.flush();
  - // As discussed on the main list - this allows Content-Length
  -// to work with servlets 
  -((JspWriterImpl)out).flushBuffer();
  + out.flush();
}
} catch (IOException ex) {
loghelper.log(Internal error flushing the buffer in release());
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-06 Thread costin
costin  2002/11/06 16:49:53

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Second attempt.
  
  Restore the flushBuffer and clean the error.
  
  I added a quick test for new exception - if they are different
  it most likely means an error in the error page - and servlet
  error handiling should take care of it.
  
  Whatever we set is cleaned up. Probably we should restore with what
  was before - but I'm not sure.
  
  Revision  ChangesPath
  1.31  +46 -30
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- PageContextImpl.java  6 Nov 2002 18:47:14 -   1.30
  +++ PageContextImpl.java  7 Nov 2002 00:49:53 -   1.31
   -105,31 +105,31 
* author Pierre Delisle
* author Mark Roth
*/
  -public class PageContextImpl 
  -extends PageContext 
  +public class PageContextImpl
  +extends PageContext
   implements VariableResolver
   {
   
   Logger.Helper loghelper = new Logger.Helper(JASPER_LOG, PageContextImpl);
  -
  +
   /**
* The expression evaluator, for evaluating EL expressions.
*/
   private ExpressionEvaluatorImpl expressionEvaluator = null;
  -
  +
   /**
* The variable resolver, for evaluating EL expressions.
*/
   private static JSTLVariableResolver variableResolver =
   new JSTLVariableResolver();
  -
  +
   /**
* Expression evaluator for proprietary EL evaluation.
* XXX - This should be going away once the EL evaluator moves from
* the JSTL implementation to its own project.
*/
   private static org.apache.jasper.runtime.el.jstl.Evaluator
  -proprietaryEvaluator = new 
  +proprietaryEvaluator = new
   org.apache.jasper.runtime.el.jstl.Evaluator();
   
   PageContextImpl(JspFactory factory) {
   -197,9 +197,9 
setAttribute(CONFIG,  config);
setAttribute(PAGECONTEXT, this);
setAttribute(APPLICATION,  context);
  - 
  +
isIncluded = request.getAttribute(
  - javax.servlet.include.servlet_path) != null;  
  + javax.servlet.include.servlet_path) != null;
   }
   
   public void release() {
   -207,18 +207,19 
try {
if (isIncluded) {
((JspWriterImpl)out).flushBuffer();
  - // push it into the including jspWriter
  +// push it into the including jspWriter
} else {
   // Old code:
  - out.flush();
  +//out.flush();
   // Do not flush the buffer even if we're not included (i.e.
   // we are the main page. The servlet will flush it and close
   // the stream.
  -//((JspWriterImpl)out).flushBuffer();
  - }
  +((JspWriterImpl)out).flushBuffer();
  +}
} catch (IOException ex) {
loghelper.log(Internal error flushing the buffer in release());
}
  +
servlet  = null;
config   = null;
context  = null;
   -231,7 +232,7 
   depth = -1;
baseOut.recycle();
session  = null;
  - 
  +
attributes.clear();
   }
   
   -451,7 +452,7 
  true);
   }
   
  -public void include(String relativeUrlPath, boolean flush) 
  +public void include(String relativeUrlPath, boolean flush)
throws ServletException, IOException {
   
   JspRuntimeLibrary.include((HttpServletRequest) request,
   -482,7 +483,7 
   }
   
   String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  -String includeUri 
  +String includeUri
   = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
   if (includeUri != null)
   request.removeAttribute(Constants.INC_SERVLET_PATH);
   -537,15 +538,15 
   public ExpressionEvaluator getExpressionEvaluator() {
   if( this.expressionEvaluator == null ) {
   this.expressionEvaluator = new ExpressionEvaluatorImpl( this );
  -// no need to synchronize - not a big deal even if we create 
  +// no need to synchronize - not a big deal even if we create
   // two of these.
   }
  -
  +
   return this.expressionEvaluator;
   }
   
   public void handlePageException(Exception ex)
  -throws IOException, ServletException 
  +throws IOException, ServletException
   {
// Should 

Re: cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-11-06 Thread Costin Manolache
I'll try to get watchdog up and run it.

Feel free to revert the patch - but if you can let it on 
for a day or something, maybe Remy or someone else has 
an idea.

I run the error page example in jsp and it worked fine. 

Costin



--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-10-29 Thread costin
costin  2002/10/29 14:29:05

  Modified:jasper2/src/share/org/apache/jasper/runtime Tag:
tomcat_4_branch PageContextImpl.java
  Log:
  Port from the main branch the Content-Length fix.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.11.2.2  +7 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.11.2.1
  retrieving revision 1.11.2.2
  diff -u -r1.11.2.1 -r1.11.2.2
  --- PageContextImpl.java  6 Aug 2002 05:31:55 -   1.11.2.1
  +++ PageContextImpl.java  29 Oct 2002 22:29:05 -  1.11.2.2
   -178,7 +178,10 
((JspWriterImpl)out).flushBuffer();
// push it into the including jspWriter
} else {
  - out.flush();
  + //out.flush();
  + // As discussed on the main list - this allows Content-Length
  +// to work with servlets 
  +((JspWriterImpl)out).flushBuffer();
}
} catch (IOException ex) {
loghelper.log(Internal error flushing the buffer in release());
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-10-24 Thread costin
costin  2002/10/24 12:18:55

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Change the 'flush' to just a 'flushBuffer'.
  
  This allows the container to deal with flushing the buffer (
  wich is done automatically if the servlet doesn't explicitely
  flush()/close() ). The container can attach the Content-Length
  header which is usefull in many cases.
  
  Revision  ChangesPath
  1.27  +11 -6 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- PageContextImpl.java  4 Oct 2002 19:21:44 -   1.26
  +++ PageContextImpl.java  24 Oct 2002 19:18:55 -  1.27
   -162,7 +162,7 
this.bufferSize   = bufferSize;
this.autoFlush= autoFlush;
this.request  = request;
  - this.response = response;
  + this.response = response;
   
// setup session (if required)
if (request instanceof HttpServletRequest  needsSession)
   -209,7 +209,12 
((JspWriterImpl)out).flushBuffer();
// push it into the including jspWriter
} else {
  - out.flush();
  +// Old code:
  + //out.flush();
  +// Do not flush the buffer even if we're not included (i.e.
  +// we are the main page. The servlet will flush it and close
  +// the stream.
  +((JspWriterImpl)out).flushBuffer();
}
} catch (IOException ex) {
loghelper.log(Internal error flushing the buffer in release());
   -226,7 +231,7 
   depth = -1;
baseOut.recycle();
session  = null;
  -
  + 
attributes.clear();
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-10-04 Thread luehe

luehe   2002/10/04 12:21:44

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixed regression (caused by fix for 12638), which prevented error pages in HTML
  format from being displayed properly.
  
  Revision  ChangesPath
  1.107 +6 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- Generator.java3 Oct 2002 23:50:11 -   1.106
  +++ Generator.java4 Oct 2002 19:21:44 -   1.107
  @@ -492,8 +492,10 @@
if (pageInfo.isSession())
out.printil(HttpSession session = null;);
   
  - if (pageInfo.isIsErrorPage())
  + if (pageInfo.isIsErrorPage()) {
   out.printil(Throwable exception = (Throwable) 
request.getAttribute(\javax.servlet.jsp.jspException\););
  + out.printil(request.setAttribute(\javax.servlet.error.exception\, 
exception););
  + }
   
out.printil(ServletContext application = null;);
out.printil(ServletConfig config = null;);
  
  
  
  1.26  +10 -5 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- PageContextImpl.java  4 Oct 2002 00:30:48 -   1.25
  +++ PageContextImpl.java  4 Oct 2002 19:21:44 -   1.26
  @@ -554,9 +554,14 @@
   
if (errorPageURL != null  !errorPageURL.equals()) {
   
  - // Set request attributes
  + // Set request attributes.
  + // Do not set the javax.servlet.error.exception attribute here
  + // (instead, set in the generated servlet code for the error page)
  + // in order to prevent the ErrorReportValve, which is invoked as
  + // part of forwarding the request to the error page, from 
  + // throwing it if the response has not been committed (the response
  + // will have been committed if the error page is a JSP page).
request.setAttribute(javax.servlet.jsp.jspException, t);
  - request.setAttribute(javax.servlet.error.exception, t);
request.setAttribute(javax.servlet.error.status_code,
new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
request.setAttribute(javax.servlet.error.request_uri,
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-10-03 Thread luehe

luehe   2002/10/03 17:30:48

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  PageContext.removeAttribute(name, scope) and
  PageContext.getAttributeNamesInScope(scope)
  now throw IllegalArgumentException when being passed an invalid scope.
  
  Revision  ChangesPath
  1.25  +6 -8  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- PageContextImpl.java  3 Oct 2002 23:50:11 -   1.24
  +++ PageContextImpl.java  4 Oct 2002 00:30:48 -   1.25
  @@ -330,6 +330,7 @@
break;
   
default:
  + throw new IllegalArgumentException(Invalid scope);
}
   }
   
  @@ -386,11 +387,8 @@
case APPLICATION_SCOPE:
return context.getAttributeNames();
   
  - default: return new Enumeration() { // empty enumeration
  - public boolean hasMoreElements() { return false; }
  -
  - public Object nextElement() { throw new NoSuchElementException(); }
  - };
  + default:
  + throw new IllegalArgumentException(Invalid scope);
}
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-09-30 Thread luehe

luehe   2002/09/30 16:45:03

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixed Bugzilla 13138 (Compliance issue.
  PageContext.setAttribute(String, Object, int) fails to throw an
  IllegalArgumentException if provide an invalid scope.)
  
  Revision  ChangesPath
  1.22  +21 -16
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- PageContextImpl.java  30 Sep 2002 23:30:35 -  1.21
  +++ PageContextImpl.java  30 Sep 2002 23:45:03 -  1.22
  @@ -246,7 +246,8 @@
   
case SESSION_SCOPE:
if (session == null)
  - throw new IllegalArgumentException(can't access SESSION_SCOPE 
without an HttpSession);
  + throw new IllegalArgumentException(
  +can't access SESSION_SCOPE without an HttpSession);
else
return session.getAttribute(name);
   
  @@ -254,7 +255,7 @@
return context.getAttribute(name);
   
default:
  - throw new IllegalArgumentException(unidentified scope);
  + throw new IllegalArgumentException(Invalid scope);
}
   }
   
  @@ -268,24 +269,26 @@
switch (scope) {
case PAGE_SCOPE:
attributes.put(name, o);
  - break;
  + break;
   
case REQUEST_SCOPE:
request.setAttribute(name, o);
  - break;
  + break;
   
case SESSION_SCOPE:
if (session == null)
  - throw new IllegalArgumentException(can't access SESSION_SCOPE 
without an HttpSession);
  + throw new IllegalArgumentException(
  +can't access SESSION_SCOPE without an HttpSession);
else
session.setAttribute(name, o);
  - break;
  + break;
   
case APPLICATION_SCOPE:
context.setAttribute(name, o);
  - break;
  + break;
   
default:
  + throw new IllegalArgumentException(Invalid scope);
}
   }
   
  @@ -293,25 +296,26 @@
switch (scope) {
case PAGE_SCOPE:
attributes.remove(name);
  - break;
  + break;
   
case REQUEST_SCOPE:
request.removeAttribute(name);
  -break;
  + break;
   
case SESSION_SCOPE:
if (session == null)
  - throw new IllegalArgumentException(can't access SESSION_SCOPE 
without an HttpSession);
  + throw new IllegalArgumentException(
  +can't access SESSION_SCOPE without an HttpSession);
else
   session.removeAttribute(name);
   // was:
   //   session.removeValue(name);
   // REVISIT Verify this is correct - akv
  - break;
  + break;
   
case APPLICATION_SCOPE:
context.removeAttribute(name);
  - break;
  + break;
   
default:
}
  @@ -364,7 +368,8 @@
if (session != null) {
return session.getAttributeNames();
} else
  - throw new IllegalArgumentException(can't access SESSION_SCOPE 
without an HttpSession);
  + throw new IllegalArgumentException(
  +can't access SESSION_SCOPE without an HttpSession);
   
case APPLICATION_SCOPE:
return context.getAttributeNames();
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-09-19 Thread luehe

luehe   2002/09/19 17:45:26

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Fixed 12638: ${pageContext.errorData.throwable.message} throws an error
  
  Revision  ChangesPath
  1.20  +14 -6 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- PageContextImpl.java  29 Aug 2002 02:04:21 -  1.19
  +++ PageContextImpl.java  20 Sep 2002 00:45:26 -  1.20
  @@ -529,15 +529,23 @@
   public void handlePageException(Throwable t)
   throws IOException, ServletException 
   {
  -// set the request attribute with the Throwable.
  - request.setAttribute(javax.servlet.jsp.jspException, t);
  -
if (errorPageURL != null  !errorPageURL.equals()) {
  +
  + // Set request attributes
  + request.setAttribute(javax.servlet.jsp.jspException, t);
  + request.setAttribute(javax.servlet.error.exception, t);
  + request.setAttribute(javax.servlet.error.status_code,
  + new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
  + request.setAttribute(javax.servlet.error.request_uri,
  + ((HttpServletRequest) request).getRequestURI());
  + request.setAttribute(javax.servlet.error.servlet_name,
  +  config.getServletName());
   try {
   forward(errorPageURL);
   } catch (IllegalStateException ise) {
   include(errorPageURL);
   }
  +
} else {
   // Otherwise throw the exception wrapped inside a ServletException.
// Set the exception as the root cause in the ServletException
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-08-19 Thread luehe

luehe   2002/08/19 16:25:42

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Implemented new PageContext method
include(String relativeUrlPath, boolean flush)
  
  Revision  ChangesPath
  1.17  +14 -12
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- PageContextImpl.java  19 Aug 2002 16:54:17 -  1.16
  +++ PageContextImpl.java  19 Aug 2002 23:25:42 -  1.17
  @@ -395,21 +395,23 @@
   }
   
   public void include(String relativeUrlPath)
  -throws ServletException, IOException
  -{
  + throws ServletException, IOException {
  +
   JspRuntimeLibrary.include((HttpServletRequest) request,
 (HttpServletResponse) response,
  -  relativeUrlPath, out, true);
  -/*
  -String path = getAbsolutePathRelativeToContext(relativeUrlPath);
  -context.getRequestDispatcher(path).include(
  - request, new ServletResponseWrapperInclude(response, out));
  -*/
  +  relativeUrlPath,
  +   out,
  +   true);
   }
   
   public void include(String relativeUrlPath, boolean flush) 
throws ServletException, IOException {
  - include(relativeUrlPath, false); // XXX
  +
  +JspRuntimeLibrary.include((HttpServletRequest) request,
  +  (HttpServletResponse) response,
  +  relativeUrlPath,
  +   out,
  +   flush);
   }
   
   public VariableResolver getVariableResolver() {
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-07-18 Thread patrickl

patrickl2002/07/18 00:28:50

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  Make source compilable under JDK 1.3 which is required by the Tomcat build.
  
  Revision  ChangesPath
  1.13  +4 -4  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PageContextImpl.java  16 Jul 2002 19:30:52 -  1.12
  +++ PageContextImpl.java  18 Jul 2002 07:28:50 -  1.13
  @@ -534,7 +534,7 @@
   ExpressionEvaluatorManager.EVALUATOR_CLASS );
   }
   catch( JspException e ) {
  -throw new RuntimeException( e );
  +throw new RuntimeException( e.toString() );
   }
   }
   
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-06-11 Thread kinman

kinman  2002/06/11 16:16:34

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Remove JspxState for now, since it is no longer used.  The code is just
commented out for now, we may need it later to pass value round other
methods.
  
  - Make sure the out is set right at the right place.
  
  Revision  ChangesPath
  1.25  +16 -21
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Generator.java11 Jun 2002 03:35:34 -  1.24
  +++ Generator.java11 Jun 2002 23:16:34 -  1.25
  @@ -373,9 +373,12 @@
// Number of tag object that need to be popped
// XXX TODO: use a better criteria
maxTagNesting = pageInfo.getMaxTagNesting();
  +/*
   if (maxTagNesting  0) {
out.printil(JspxState _jspxState = new JspxState(););
   }
  +*/
  +out.printil(JspWriter _jspx_out = null;);
   
out.printil(try {);
out.pushIndent();
  @@ -400,9 +403,7 @@
if (pageInfo.isSession())
out.printil(session = pageContext.getSession(););
out.printil(out = pageContext.getOut(););
  -if (maxTagNesting  0) {
  -out.printil(_jspxState.out = out;);
  -}
  +out.printil(_jspx_out = out;);
out.println();
   }
   
  @@ -426,20 +427,19 @@
* 1. Servlet state object, used to pass servlet info round methods.
*/
   private void generateJspState() {
  +/*
out.println();
out.printil(static final class JspxState {);
out.pushIndent();
  - out.printil(public int tagCount;);
  - out.println();
out.printil(public JspWriter out;);
out.println();
out.printil(public JspxState() {);
out.pushIndent();
  - out.printil(tagCount = 0;);
out.popIndent();
out.printil(});
out.popIndent();
out.printil(});
  +*/
   }
   
   /**
  @@ -1019,7 +1019,8 @@
out.print(parent);
out.print(, );
}
  - out.println(pageContext, _jspxState););
  +//   out.println(pageContext, _jspxState););
  + out.println(pageContext););
   
// Set up new buffer for the method
outSave = out;
  @@ -1038,7 +1039,8 @@
out.print(parent);
out.print(, );
}
  - out.println(javax.servlet.jsp.PageContext pageContext, JspxState 
_jspxState));
  +//   out.println(javax.servlet.jsp.PageContext pageContext, JspxState 
_jspxState));
  + out.println(javax.servlet.jsp.PageContext pageContext));
out.printil(throws Throwable {);
out.pushIndent();
   
  @@ -1245,10 +1247,6 @@
out.println( != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) 
{);
// Assume EVAL_BODY_BUFFERED
out.pushIndent();
  - 
  -if (!implementsTryCatchFinally) {
  -out.printil(_jspxState.tagCount++;);
  - }
   out.printil(javax.servlet.jsp.tagext.BodyContent _bc = 
pageContext.pushBody(););
   out.printil(_bc.clear(););
   out.printil(out = _bc;);
  @@ -1309,9 +1307,6 @@
out.print(tagEvalVar);
out.println( != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE));
out.pushIndent();
  -if (!implementsTryCatchFinally) {
  -out.printil(_jspxState.tagCount--;);
  - }
   out.printil(out = pageContext.popBody(););
out.popIndent();
}
  @@ -1347,8 +1342,8 @@
   out.printil(});
   } else {
   out.printin(n.getTagHandlerPoolName());
  -out.println(.reuse();
  - out.printin(tagHandlerVar);
  +out.print(.reuse();
  + out.print(tagHandlerVar);
out.println(););
}
   
  @@ -1556,6 +1551,7 @@
   out.printil(} catch (Throwable t) {);
   out.pushIndent();
   
  +out.printil(out = _jspx_out;);
   out.printil(if (out != null  out.getBufferSize() != 0));
   out.pushIndent();
   out.printil(out.clearBuffer(););
  @@ -1567,7 +1563,6 @@
   out.printil(} finally {);
   out.pushIndent();
   
  -out.printil(out 

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-06-10 Thread remm

remm2002/06/10 20:35:35

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Take advantage of the fact that the PageContext is pooled.
  - Modify the way the buffer reuse is done to conform with the PageContext
contract (basically, the code moves from the generated servlet to PageContext).
  
  Revision  ChangesPath
  1.24  +14 -47
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Generator.java10 Jun 2002 21:08:30 -  1.23
  +++ Generator.java11 Jun 2002 03:35:34 -  1.24
  @@ -358,7 +358,7 @@
   
// Local variable declarations
out.printil(JspFactory _jspxFactory = null;);
  - out.printil(org.apache.jasper.runtime.PageContextImpl pageContext = null;);
  + out.printil(javax.servlet.jsp.PageContext pageContext = null;);
if (pageInfo.isSession())
out.printil(HttpSession session = null;);
   
  @@ -386,8 +386,7 @@
out.print  (quote(pageInfo.getContentType()));
out.println(););
   
  - out.printil(pageContext = (org.apache.jasper.runtime.PageContextImpl)
  -+  _jspxFactory.getPageContext(this, request, response,);
  + out.printil(pageContext = _jspxFactory.getPageContext(this, request, 
response,);
out.printin(\t\t\t);
out.print  (quote(pageInfo.getErrorPage()));
out.print  (,  + pageInfo.isSession());
  @@ -432,17 +431,11 @@
out.pushIndent();
out.printil(public int tagCount;);
out.println();
  - out.printil(public int tagDepth;);
  - out.println();
  - out.printil(public javax.servlet.jsp.tagext.BodyContent[] outs;);
  - out.println();
out.printil(public JspWriter out;);
out.println();
out.printil(public JspxState() {);
out.pushIndent();
out.printil(tagCount = 0;);
  - out.printil(tagDepth = -1;);
  - out.printil(outs = new org.apache.jasper.runtime.BodyContentImpl[ + 
(maxTagNesting) + ];);
out.popIndent();
out.printil(});
out.popIndent();
  @@ -1045,21 +1038,12 @@
out.print(parent);
out.print(, );
}
  - out.println(org.apache.jasper.runtime.PageContextImpl pageContext, 
JspxState _jspxState));
  + out.println(javax.servlet.jsp.PageContext pageContext, JspxState 
_jspxState));
out.printil(throws Throwable {);
out.pushIndent();
   
// Initilaize local variables used in this method.
  - out.printil(JspWriter out = null;);
  -out.printil(if (_jspxState.tagDepth  0) {);
  - out.pushIndent();
  -out.printil(out = _jspxState.out;);
  - out.popIndent();
  -out.printil(} else {);
  - out.pushIndent();
  -out.printil(out = _jspxState.outs[_jspxState.tagDepth];);
  - out.popIndent();
  -out.printil(});
  + out.printil(JspWriter out = pageContext.getOut(););
if (n.isHasUsebean()) {
out.println(HttpSession session = pageContext.getSession(););
out.println(ServletContext application = 
pageContext.getServletContext(););
  @@ -1265,23 +1249,12 @@
   if (!implementsTryCatchFinally) {
   out.printil(_jspxState.tagCount++;);
}
  -out.printil(_jspxState.tagDepth++;);
  -
  -out.printil(if (_jspxState.outs[_jspxState.tagDepth] == null) 
{);
  - out.pushIndent();
  -out.printil(_jspxState.outs[_jspxState.tagDepth] = new 
org.apache.jasper.runtime.BodyContentImpl(out););
  - out.popIndent();
  - out.printil(} else {);
  - out.pushIndent();
  - out.printil(_jspxState.outs[_jspxState.tagDepth].clear(););
  - out.popIndent();
  - out.printil(});
  -
  -out.printil(out = _jspxState.outs[_jspxState.tagDepth];);
  - out.printil(pageContext.setOut(out););
  +out.printil(javax.servlet.jsp.tagext.BodyContent _bc = 
pageContext.pushBody(););
  +out.printil(_bc.clear(););
  +out.printil(out = _bc;);
   
out.printin(tagHandlerVar);
  - 
out.println(.setBodyContent(_jspxState.outs[_jspxState.tagDepth]););
  + 

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-06-09 Thread remm

remm2002/06/09 18:32:57

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Add some new methods to more intelligently allocate the buffers.
  
  Revision  ChangesPath
  1.7   +19 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PageContextImpl.java  6 Jun 2002 00:19:48 -   1.6
  +++ PageContextImpl.java  10 Jun 2002 01:32:57 -  1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.6 2002/06/06 00:19:48 kinman Exp $
  - * $Revision: 1.6 $
  - * $Date: 2002/06/06 00:19:48 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.7 2002/06/10 01:32:57 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/06/10 01:32:57 $
*
* 
*
  @@ -426,6 +426,22 @@
   request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
request.setAttribute(Constants.FORWARD_SEEN, true);
   }
  +}
  +
  +public BodyContent allocateBody(JspWriter bodyContent, 
  +JspWriter previous) {
  +
  +if (bodyContent == null) {
  +return new BodyContentImpl(previous);
  +} else {
  +((BodyContentImpl) bodyContent).setEnclosingWriter(previous);
  +return (BodyContent) bodyContent;
  +}
  +
  +}
  +
  +public void setOut(JspWriter newOut) {
  +out = newOut;
   }
   
   Stack writerStack = new Stack();
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java JspException.java

2002-06-05 Thread kinman

kinman  2002/06/05 17:19:48

  Modified:jasper2/src/share/org/apache/jasper/logging
JasperLogger.java Logger.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Removed: jasper2/src/share/org/apache/jasper/core
JasperException.java
   jasper2/src/share/org/apache/jasper/runtime
JspException.java
  Log:
  - Removed unused exceptions classes.
  
  Revision  ChangesPath
  1.2   +0 -1  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/logging/JasperLogger.java
  
  Index: JasperLogger.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/logging/JasperLogger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JasperLogger.java 28 Mar 2002 18:46:18 -  1.1
  +++ JasperLogger.java 6 Jun 2002 00:19:48 -   1.2
  @@ -66,7 +66,6 @@
   import javax.servlet.ServletContext;
   
   import org.apache.jasper.util.Queue;
  -//import org.apache.jasper.core.JasperException;
   
   /**
* A real implementation of the Logger abstraction. 
  
  
  
  1.2   +0 -8  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/logging/Logger.java
  
  Index: Logger.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/logging/Logger.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Logger.java   28 Mar 2002 18:46:18 -  1.1
  +++ Logger.java   6 Jun 2002 00:19:48 -   1.2
  @@ -69,7 +69,6 @@
   import java.text.SimpleDateFormat;
   
   import javax.servlet.ServletException;   // for throwableToString()
  -import org.apache.jasper.core.JasperException;   // for throwableToString()
   import org.apache.jasper.util.FastDateFormat;
   
   /**
  @@ -210,13 +209,6 @@
t.printStackTrace(w);
if (t instanceof ServletException) {
Throwable cause = ((ServletException)t).getRootCause();
  - if (cause != null) {
  - w.println(rootcause);
  - printThrowable(w, cause, rootcause);
  - }
  - }
  - else if (t instanceof JasperException) {
  - Throwable cause = ((JasperException)t).getRootCause();
if (cause != null) {
w.println(rootcause);
printThrowable(w, cause, rootcause);
  
  
  
  1.6   +4 -3  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PageContextImpl.java  15 May 2002 20:42:03 -  1.5
  +++ PageContextImpl.java  6 Jun 2002 00:19:48 -   1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.5 2002/05/15 20:42:03 kinman Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/05/15 20:42:03 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.6 2002/06/06 00:19:48 kinman Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/06/06 00:19:48 $
*
* 
*
  @@ -85,6 +85,7 @@
   import javax.servlet.jsp.JspFactory;
   import javax.servlet.jsp.JspWriter;
   import javax.servlet.jsp.tagext.BodyContent;
  +import javax.servlet.jsp.JspException;
   
   import org.apache.jasper.Constants;
   import org.apache.jasper.logging.Logger;
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-05-15 Thread kinman

kinman  02/05/15 13:42:03

  Modified:jasper2/src/share/org/apache/jasper/compiler
ErrorDispatcher.java Generator.java Node.java
Validator.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Fixed ErrorDispatcher is show javac error message even if there is no mapping.
  - Fixed codegen for plugins: allow rt expressions for width and height
attributes; and a missing java_code attribute.
  
  Revision  ChangesPath
  1.2   +13 -5 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java
  
  Index: ErrorDispatcher.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ErrorDispatcher.java  28 Mar 2002 18:46:18 -  1.1
  +++ ErrorDispatcher.java  15 May 2002 20:42:03 -  1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java,v
 1.1 2002/03/28 18:46:18 kinman Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/28 18:46:18 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java,v
 1.2 2002/05/15 20:42:03 kinman Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/05/15 20:42:03 $
*
* 
* 
  @@ -479,9 +479,11 @@
ErrorVisitor errVisitor = new ErrorVisitor(lineNum);
page.visit(errVisitor);
errNode = errVisitor.getJspSourceNode();
  +/* XXX Supress map exception to display the original error
if (errNode == null) {
jspError(jsp.error.source.map, lineNumStr);
}
  +*/
   }
partialErrMsg.append(line);
partialErrMsg.append('\n');
  @@ -490,10 +492,16 @@
   reader.close();
   
// add last error to error vector
  + String pageFile = null;
  + int pageLine = -1;
  + if (errNode != null) {
  + pageFile = errNode.getStart().getFile();
  + pageLine = errNode.getStart().getLineNumber();
  + }
errVec.add(new JavacErrorDetail(fname,
lineNum,
  - errNode.getStart().getFile(),
  - errNode.getStart().getLineNumber(),
  + pageFile,
  + pageLine,
partialErrMsg.toString()));
   
JavacErrorDetail[] errDetails = null;
  
  
  
  1.14  +47 -25
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Generator.java11 May 2002 01:19:57 -  1.13
  +++ Generator.java15 May 2002 20:42:03 -  1.14
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.13 2002/05/11 01:19:57 kinman Exp $
  - * $Revision: 1.13 $
  - * $Date: 2002/05/11 01:19:57 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.14 2002/05/15 20:42:03 kinman Exp $
  + * $Revision: 1.14 $
  + * $Date: 2002/05/15 20:42:03 $
*
* 
* 
  @@ -668,8 +668,8 @@
String type = n.getAttributeValue(type);
String code = n.getAttributeValue(code);
String name = n.getAttributeValue(name);
  - String width = n.getAttributeValue(width);
  - String height = n.getAttributeValue(height);
  + Node.JspAttribute height = n.getHeight();
  + Node.JspAttribute width = n.getWidth();
String hspace = n.getAttributeValue(hspace);
String vspace = n.getAttributeValue(vspace);
String align = n.getAttributeValue(align);
  @@ -689,17 +689,28 @@
// IE style plugin
// OBJECT ...
// First compose the runtime output string 
  - String s0 = OBJECT classid= + ctxt.getOptions().getIeClassId() +
  - makeAttr(name, name) +
  - makeAttr(width, width) +
  - makeAttr(height, height) +
  - makeAttr(hspace, hspace) +
  - makeAttr(vspace, vspace) +
  -  

cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-05-06 Thread kinman

kinman  02/05/06 13:07:43

  Modified:jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Fixed 5998.  Thanks [EMAIL PROTECTED] for the patch.
  
  Revision  ChangesPath
  1.4   +10 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PageContextImpl.java  25 Apr 2002 18:16:06 -  1.3
  +++ PageContextImpl.java  6 May 2002 20:07:43 -   1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.3 2002/04/25 18:16:06 kinman Exp $
  - * $Revision: 1.3 $
  - * $Date: 2002/04/25 18:16:06 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.4 2002/05/06 20:07:43 kinman Exp $
  + * $Revision: 1.4 $
  + * $Date: 2002/05/06 20:07:43 $
*
* 
*
  @@ -468,6 +468,13 @@
if (t instanceof IOException) throw (IOException)t;
if (t instanceof ServletException) throw (ServletException)t;
   if (t instanceof RuntimeException) throw (RuntimeException)t;
  +if (t instanceof JspException ) {
  +Throwable rootCause = ((JspException)t).getRootCause();
  +if( rootCause != null )
  +throw new ServletException( t.getMessage(), rootCause );
  +else
  +throw new ServletException( t );
  +}
throw new ServletException(t);
}
   }
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime PageContextImpl.java

2002-04-25 Thread kinman

kinman  02/04/25 11:16:06

  Modified:jasper2/src/share/org/apache/jasper/compiler Generator.java
   jasper2/src/share/org/apache/jasper/runtime
PageContextImpl.java
  Log:
  - Fixed 6196.  If the buffer was flushed, a forward should cause a
IllegalStateException instead of IOException.
  
  Revision  ChangesPath
  1.6   +3 -5  
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java
  
  Index: Generator.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Generator.java19 Apr 2002 20:35:01 -  1.5
  +++ Generator.java25 Apr 2002 18:16:06 -  1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.5 2002/04/19 20:35:01 kinman Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/04/19 20:35:01 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Generator.java,v
 1.6 2002/04/25 18:16:06 kinman Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/04/25 18:16:06 $
*
* 
* 
  @@ -361,8 +361,6 @@
   
out.printil(if (true) {); // So that javac won't complain about
out.pushIndent();   // codes after return
  -
  - out.printil(out.clear(););
out.printin(pageContext.forward();
out.print  (attributeValue(n.getPage(), false));
printParams(n);
  
  
  
  1.3   +11 -3 
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java
  
  Index: PageContextImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PageContextImpl.java  31 Mar 2002 09:02:52 -  1.2
  +++ PageContextImpl.java  25 Apr 2002 18:16:06 -  1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.2 2002/03/31 09:02:52 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2002/03/31 09:02:52 $
  + * $Header: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/runtime/PageContextImpl.java,v
 1.3 2002/04/25 18:16:06 kinman Exp $
  + * $Revision: 1.3 $
  + * $Date: 2002/04/25 18:16:06 $
*
* 
*
  @@ -401,6 +401,14 @@
   public void forward(String relativeUrlPath)
   throws ServletException, IOException
   {
  + // JSP.4.5 If the buffer was flushed, throw IllegalStateException
  + try {
  + out.clear();
  + } catch (IOException ex) {
  + throw new IllegalStateException(Constants.getString(
  + jsp.error.attempt_to_clear_flushed_buffer));
  + }
  +
// Make sure that the response object is not the wrapper for include
while (response instanceof HttpServletResponseWrapper)
response = ((HttpServletResponseWrapper)response).getResponse();
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]