Update of /cvsroot/cruisecontrol/cruisecontrol/reporting/jsp/src/net/sourceforge/cruisecontrol/taglib
In directory sc8-pr-cvs1:/tmp/cvs-serv1462/src/net/sourceforge/cruisecontrol/taglib
Modified Files:
CruiseControlTagSupport.java NavigationTag.java
TabSheetTag.java XSLTag.java
Added Files:
CruiseControlBodyTagSupport.java
Log Message:
Multiple changes to support JSP 1.1 (Tomcat 3.3; also tested with Tomcat 4.1.24)
- main.jsp: jsp:includes have been inlined. this is because jsp 1.1 requires
flush=true on jsp:includes and you can't have flush=true in the body
of a custom tag. Thus the way we were constructing the tabs didn't
work with JSP 1.1.
- CruiseControlTagSupport extends TagSupport: in JSP 1.1 instances of BodyTag
are not allowed to return EVAL_BODY_INCLUDE.
- added CruiseControlBodyTagSupport: this is to support those tags that use
the body content. Extends CruiseControlTagSupport and implements BodyTag.
- NavigationTag, TabSheetTag, XSLTag: now extend the CruiseControlBodyTagSupport
--- NEW FILE: CruiseControlBodyTagSupport.java ---
/********************************************************************************
* CruiseControl, a Continuous Integration Toolkit
* Copyright (c) 2003, ThoughtWorks, Inc.
* 651 W Washington Ave. Suite 500
* Chicago, IL 60661 USA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* + Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* + Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* + Neither the name of ThoughtWorks, Inc., CruiseControl, nor the
* names of its contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************************/
package net.sourceforge.cruisecontrol.taglib;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTag;
/**
* Compatable with JSP 1.1 & Servlet 2.2 (Tomcat 3.3)
* @author jfredrick
*/
public class CruiseControlBodyTagSupport extends CruiseControlTagSupport implements BodyTag {
private BodyContent bodyContent;
public void setBodyContent(BodyContent content) {
bodyContent = content;
}
public BodyContent getBodyContent() {
return bodyContent;
}
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
}
public int doAfterBody() throws JspException {
return SKIP_BODY;
}
public JspWriter getPreviousOut() {
return bodyContent.getEnclosingWriter();
}
public void release() {
super.release();
bodyContent = null;
}
/**
* @see javax.servlet.jsp.tagext.BodyTag#doInitBody()
*/
public void doInitBody() throws JspException {
}
}
Index: CruiseControlTagSupport.java
===================================================================
RCS file: /cvsroot/cruisecontrol/cruisecontrol/reporting/jsp/src/net/sourceforge/cruisecontrol/taglib/CruiseControlTagSupport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CruiseControlTagSupport.java 2 Apr 2003 02:17:33 -0000 1.3
+++ CruiseControlTagSupport.java 25 May 2003 03:23:08 -0000 1.4
@@ -42,13 +42,13 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
-import javax.servlet.jsp.tagext.BodyTagSupport;
+import javax.servlet.jsp.tagext.TagSupport;
/**
* A helper class to consolidate tags that deal with log files.
* @author <a href="mailto:robertdw@... Watkins</a>
*/
-public class CruiseControlTagSupport extends BodyTagSupport {
+public class CruiseControlTagSupport extends TagSupport {
protected void info(String message) {
System.out.println(message);
}
Index: NavigationTag.java
===================================================================
RCS file: /cvsroot/cruisecontrol/cruisecontrol/reporting/jsp/src/net/sourceforge/cruisecontrol/taglib/NavigationTag.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- NavigationTag.java 31 Mar 2003 01:52:45 -0000 1.17
+++ NavigationTag.java 25 May 2003 03:23:08 -0000 1.18
@@ -49,7 +49,7 @@
/**
*
*/
-public class NavigationTag extends CruiseControlTagSupport {
+public class NavigationTag extends CruiseControlBodyTagSupport {
public static final String LABEL_SEPARATOR = "L";
public static final SimpleDateFormat US_DATE_FORMAT = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
public static final String LINK_TEXT_ATTR = "linktext";
Index: TabSheetTag.java
===================================================================
RCS file: /cvsroot/cruisecontrol/cruisecontrol/reporting/jsp/src/net/sourceforge/cruisecontrol/taglib/TabSheetTag.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TabSheetTag.java 28 Mar 2003 06:56:57 -0000 1.8
+++ TabSheetTag.java 25 May 2003 03:23:08 -0000 1.9
@@ -51,7 +51,7 @@
*
* @author <a href="mailto:robertdw@... Watkins</a>
*/
-public class TabSheetTag extends CruiseControlTagSupport {
+public class TabSheetTag extends CruiseControlBodyTagSupport {
private List tabs = new ArrayList();
private Tab selectedTab;
private static final Tab NONE_SELECTED = null;
Index: XSLTag.java
===================================================================
RCS file: /cvsroot/cruisecontrol/cruisecontrol/reporting/jsp/src/net/sourceforge/cruisecontrol/taglib/XSLTag.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- XSLTag.java 2 Apr 2003 06:41:56 -0000 1.17
+++ XSLTag.java 25 May 2003 03:23:08 -0000 1.18
@@ -46,10 +46,9 @@
import java.net.URL;
import java.net.URLConnection;
import java.util.Arrays;
+
import javax.servlet.ServletContext;
import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.BodyTag;
-import javax.servlet.jsp.tagext.Tag;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
@@ -62,7 +61,7 @@
*
* @author alden almagro, ThoughtWorks, Inc. 2002
*/
-public class XSLTag extends CruiseControlTagSupport implements Tag, BodyTag {
+public class XSLTag extends CruiseControlBodyTagSupport {
private static final String DEFAULT_XSL_ROOT = "/xsl/";
private String xslFileName;
private String xslRootContext = DEFAULT_XSL_ROOT;
|