cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/template GetTag.java InsertTag.java
martinc 02/03/11 21:55:08 Modified:src/share/org/apache/struts/taglib/template GetTag.java InsertTag.java Log: Don't use the JSPException constructor which takes a Throwable, since that is available only in Servlets 2.3, and we want to remain compatible with Servlets 2.2 for now. Revision ChangesPath 1.12 +7 -7 jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java Index: GetTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- GetTag.java 11 Mar 2002 04:56:53 - 1.11 +++ GetTag.java 12 Mar 2002 05:55:08 - 1.12 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.11 2002/03/11 04:56:53 martinc Exp $ - * $Revision: 1.11 $ - * $Date: 2002/03/11 04:56:53 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.12 2002/03/12 05:55:08 martinc Exp $ + * $Revision: 1.12 $ + * $Date: 2002/03/12 05:55:08 $ * * * @@ -77,7 +77,7 @@ * it, depending upon the value of the content's direct attribute. * * @author David Geary - * @version $Revision: 1.11 $ $Date: 2002/03/11 04:56:53 $ + * @version $Revision: 1.12 $ $Date: 2002/03/12 05:55:08 $ */ public class GetTag extends TagSupport { @@ -181,7 +181,7 @@ } catch(IOException ex) { saveException(ex); - throw new JspException(ex); + throw new JspException(ex.getMessage()); } } else { @@ -191,10 +191,10 @@ pageContext.include(content.toString()); } catch (IOException ex) { saveException(ex); - throw new JspException(ex); + throw new JspException(ex.getMessage()); } catch(ServletException ex) { saveException(ex); - throw new JspException(ex); + throw new JspException(ex.getMessage()); } } } 1.11 +6 -6 jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java Index: InsertTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- InsertTag.java11 Mar 2002 04:56:53 - 1.10 +++ InsertTag.java12 Mar 2002 05:55:08 - 1.11 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v 1.10 2002/03/11 04:56:53 martinc Exp $ - * $Revision: 1.10 $ - * $Date: 2002/03/11 04:56:53 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v 1.11 2002/03/12 05:55:08 martinc Exp $ + * $Revision: 1.11 $ + * $Date: 2002/03/12 05:55:08 $ * * * @@ -77,7 +77,7 @@ * tags, which are accessed by lt;template:getgt; in the template. * * @author David Geary - * @version $Revision: 1.10 $ $Date: 2002/03/11 04:56:53 $ + * @version $Revision: 1.11 $ $Date: 2002/03/12 05:55:08 $ */ public class InsertTag extends TagSupport { @@ -155,10 +155,10 @@ pageContext.include(prefix + template); } catch (IOException ex) { saveException(ex); -throw new JspException(ex); +throw new JspException(ex.getMessage()); } catch(ServletException ex) { saveException(ex); - throw new JspException(ex); + throw new JspException(ex.getMessage()); } ContentMapStack.pop(pageContext); return EVAL_PAGE; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/template GetTag.java InsertTag.java
craigmcc01/04/28 20:59:05 Modified:src/share/org/apache/struts/taglib/template GetTag.java InsertTag.java Log: If template:get or template:insert throw an exception, do not override a nested exception already created by an included JSP page if it already exists at the standard Action.EXCEPTION_KEY request attribute key. PR: Bugzilla #1324 Submitted by: Dmitri Plotnikov [EMAIL PROTECTED] Revision ChangesPath 1.8 +24 -8 jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java Index: GetTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- GetTag.java 2001/02/26 16:44:16 1.7 +++ GetTag.java 2001/04/29 03:59:04 1.8 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.7 2001/02/26 16:44:16 dgeary Exp $ - * $Revision: 1.7 $ - * $Date: 2001/02/26 16:44:16 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.8 2001/04/29 03:59:04 craigmcc Exp $ + * $Revision: 1.8 $ + * $Date: 2001/04/29 03:59:04 $ * * * @@ -75,7 +75,7 @@ * it, depending upon the value of the content's direct attribute. * * @author David Geary - * @version $Revision: 1.7 $ $Date: 2001/02/26 16:44:16 $ + * @version $Revision: 1.8 $ $Date: 2001/04/29 03:59:04 $ */ public class GetTag extends TagSupport { @@ -152,8 +152,7 @@ pageContext.getOut().print(content.toString()); } catch(java.io.IOException ex) { - pageContext.setAttribute(Action.EXCEPTION_KEY, ex, -PageContext.REQUEST_SCOPE); + saveException(ex); throw new JspException(ex.getMessage()); } } @@ -162,8 +161,7 @@ pageContext.include(content.toString()); } catch(Exception ex) { - pageContext.setAttribute(Action.EXCEPTION_KEY, ex, -PageContext.REQUEST_SCOPE); + saveException(ex); throw new JspException(ex.getMessage()); } } @@ -183,5 +181,23 @@ name = role = null; } + + +/** + * Save the specified exception in request scope if there is not already + * one present. + * + * @param exception Exception to be conditionally saved + */ +private void saveException(Throwable exception) { + +if (pageContext.getAttribute(Action.EXCEPTION_KEY, + PageContext.REQUEST_SCOPE) != null) +return; +pageContext.setAttribute(Action.EXCEPTION_KEY, exception, + PageContext.REQUEST_SCOPE); + +} + } 1.7 +23 -6 jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java Index: InsertTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- InsertTag.java2001/02/26 16:44:16 1.6 +++ InsertTag.java2001/04/29 03:59:05 1.7 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v 1.6 2001/02/26 16:44:16 dgeary Exp $ - * $Revision: 1.6 $ - * $Date: 2001/02/26 16:44:16 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v 1.7 2001/04/29 03:59:05 craigmcc Exp $ + * $Revision: 1.7 $ + * $Date: 2001/04/29 03:59:05 $ * * * @@ -74,7 +74,7 @@ * tags, which are accessed by lt;template:getgt; in the template. * * @author David Geary - * @version $Revision: 1.6 $ $Date: 2001/02/26 16:44:16 $ + * @version $Revision: 1.7 $ $Date: 2001/04/29 03:59:05 $ */ public class InsertTag extends TagSupport { @@ -145,8 +145,7 @@ pageContext.include(template); } catch(Exception ex) { // IOException or ServletException - pageContext.setAttribute(Action.EXCEPTION_KEY, ex, - PageContext.REQUEST_SCOPE); + saveException(ex); throw new JspException(ex.getMessage()); } ContentMapStack.pop(pageContext); @@ -177,5 +176,23 @@ map = null; } + + +/** + *
cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/template GetTag.java InsertTag.java PutTag.java
dgeary 01/01/22 11:46:03 Modified:src/share/org/apache/struts/taglib/template GetTag.java InsertTag.java PutTag.java Log: Added calls to super.release in tag release methods. Thanks to Wong Kok Wai ([EMAIL PROTECTED]) for suggesting this change. Revision ChangesPath 1.6 +7 -5 jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java Index: GetTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- GetTag.java 2001/01/19 01:26:01 1.5 +++ GetTag.java 2001/01/22 19:45:57 1.6 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.5 2001/01/19 01:26:01 dgeary Exp $ - * $Revision: 1.5 $ - * $Date: 2001/01/19 01:26:01 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/GetTag.java,v 1.6 2001/01/22 19:45:57 dgeary Exp $ + * $Revision: 1.6 $ + * $Date: 2001/01/22 19:45:57 $ * * * @@ -75,7 +75,7 @@ * it, depending upon the value of the content's direct attribute. * * @author David Geary - * @version $Revision: 1.5 $ $Date: 2001/01/19 01:26:01 $ + * @version $Revision: 1.6 $ $Date: 2001/01/22 19:45:57 $ */ public class GetTag extends TagSupport { @@ -156,10 +156,12 @@ /** - * Reset member values for reuse. + * Reset member values for reuse. This method calls super.release(), + * which invokes TagSupport.release(), which typically does nothing. */ public void release() { + super.release(); name = role = null; } 1.4 +7 -5 jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java Index: InsertTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- InsertTag.java2001/01/19 01:26:01 1.3 +++ InsertTag.java2001/01/22 19:45:58 1.4 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v 1.3 2001/01/19 01:26:01 dgeary Exp $ - * $Revision: 1.3 $ - * $Date: 2001/01/19 01:26:01 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/InsertTag.java,v 1.4 2001/01/22 19:45:58 dgeary Exp $ + * $Revision: 1.4 $ + * $Date: 2001/01/22 19:45:58 $ * * * @@ -74,7 +74,7 @@ * tags, which are accessed by lt;template:getgt; in the template. * * @author David Geary - * @version $Revision: 1.3 $ $Date: 2001/01/19 01:26:01 $ + * @version $Revision: 1.4 $ $Date: 2001/01/22 19:45:58 $ */ public class InsertTag extends TagSupport { @@ -148,10 +148,12 @@ /** - * Reset member variables. + * Reset member values for reuse. This method calls super.release(), + * which invokes TagSupport.release(), which typically does nothing. */ public void release() { + super.release(); template = null; map = null; 1.7 +7 -5 jakarta-struts/src/share/org/apache/struts/taglib/template/PutTag.java Index: PutTag.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/PutTag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PutTag.java 2001/01/16 23:48:41 1.6 +++ PutTag.java 2001/01/22 19:45:59 1.7 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/PutTag.java,v 1.6 2001/01/16 23:48:41 dgeary Exp $ - * $Revision: 1.6 $ - * $Date: 2001/01/16 23:48:41 $ + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/template/PutTag.java,v 1.7 2001/01/22 19:45:59 dgeary Exp $ + * $Revision: 1.7 $ + * $Date: 2001/01/22 19:45:59 $ * * * @@ -74,7 +74,7 @@ * Tag handler for lt;template:putgt;, which puts content into request scope. * * @author David Geary - * @version $Revision: 1.6 $ $Date: 2001/01/16 23:48:41 $ + * @version $Revision: 1.7 $ $Date: 2001/01/22 19:45:59 $ */ public class PutTag extends BodyTagSupport { @@ -176,10 +176,12 @@ /** - * Reset member variables. + * Reset member values for reuse. This method calls