Return-Path: Delivered-To: apmail-jakarta-struts-dev-archive@apache.org Received: (qmail 84611 invoked from network); 18 May 2003 16:29:52 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 18 May 2003 16:29:52 -0000 Received: (qmail 16828 invoked by uid 97); 18 May 2003 16:32:01 -0000 Delivered-To: qmlist-jakarta-archive-struts-dev@nagoya.betaversion.org Received: (qmail 16821 invoked from network); 18 May 2003 16:32:01 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 18 May 2003 16:32:01 -0000 Received: (qmail 83955 invoked by uid 500); 18 May 2003 16:29:45 -0000 Mailing-List: contact struts-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list struts-dev@jakarta.apache.org Received: (qmail 83944 invoked from network); 18 May 2003 16:29:45 -0000 Received: from f111.law15.hotmail.com (HELO hotmail.com) (64.4.23.111) by daedalus.apache.org with SMTP; 18 May 2003 16:29:45 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 18 May 2003 09:29:49 -0700 Received: from 12.252.55.153 by lw15fd.law15.hotmail.msn.com with HTTP; Sun, 18 May 2003 16:29:48 GMT X-Originating-IP: [12.252.55.153] X-Originating-Email: [dgraham1980@hotmail.com] From: "David Graham" To: struts-dev@jakarta.apache.org Bcc: Subject: Re: cvs commit: jakarta-struts/src/share/org/apache/struts/util RequestUtils.java Date: Sun, 18 May 2003 10:29:48 -0600 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 18 May 2003 16:29:49.0191 (UTC) FILETIME=[B37A6170:01C31D5A] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N >If only TagLibs use isXhtml() wouldn't placing it under >o.a.s.taglib.util prevent RequestUtils from getting >even bigger than what it already is ? I agree but wan't sure how everyone would feel about me adding a class at this point. We can move that method with the rest of the JSP related methods to a new class for 1.2. David > > > >dgraham@apache.org wrote: > >>dgraham 2003/05/16 18:56:51 >> >> Modified: src/share/org/apache/struts/taglib/html >> JavascriptValidatorTag.java FormTag.java >> BaseTag.java >> src/share/org/apache/struts/util RequestUtils.java >> Log: >> Moved xhtml check to RequestUtils instead of duplicating the logic in >>many >> >> different classes. This method should move to our view utility class >>when >> >> RequestUtils is refactored. >> Revision Changes Path >> 1.26 +5 -8 >>jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java >> Index: JavascriptValidatorTag.java >> =================================================================== >> RCS file: >>/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java,v >> retrieving revision 1.25 >> retrieving revision 1.26 >> diff -u -r1.25 -r1.26 >> --- JavascriptValidatorTag.java 4 Apr 2003 06:41:09 -0000 1.25 >> +++ JavascriptValidatorTag.java 17 May 2003 01:56:51 -0000 1.26 >> @@ -695,10 +695,7 @@ >> * Returns true if this is an xhtml page. >> */ >> private boolean isXhtml() { >> - String xhtml = >> - (String) this.pageContext.getAttribute(Globals.XHTML_KEY, >>PageContext.PAGE_SCOPE); >> - >> - return ("true".equalsIgnoreCase(xhtml)); >> + return RequestUtils.isXhtml(this.pageContext); >> } >> /** >> 1.48 +6 -10 >>jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java >> Index: FormTag.java >> =================================================================== >> RCS file: >>/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/FormTag.java,v >> retrieving revision 1.47 >> retrieving revision 1.48 >> diff -u -r1.47 -r1.48 >> --- FormTag.java 15 May 2003 02:33:40 -0000 1.47 >> +++ FormTag.java 17 May 2003 01:56:51 -0000 1.48 >> @@ -842,13 +842,9 @@ >> /** >> * Returns true if this tag should render as xhtml. >> - * @since Struts 1.1 >> */ >> - protected boolean isXhtml() { >> - String xhtml = >> - (String) this.pageContext.getAttribute(Globals.XHTML_KEY, >>PageContext.PAGE_SCOPE); >> - >> - return ("true".equalsIgnoreCase(xhtml)); >> + private boolean isXhtml() { >> + return RequestUtils.isXhtml(this.pageContext); >> } >> /** >> 1.16 +7 -17 >>jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java >> Index: BaseTag.java >> =================================================================== >> RCS file: >>/home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/BaseTag.java,v >> retrieving revision 1.15 >> retrieving revision 1.16 >> diff -u -r1.15 -r1.16 >> --- BaseTag.java 16 May 2003 12:34:50 -0000 1.15 >> +++ BaseTag.java 17 May 2003 01:56:51 -0000 1.16 >> @@ -71,6 +71,7 @@ >> import org.apache.struts.Globals; >> import org.apache.struts.util.MessageResources; >> +import org.apache.struts.util.RequestUtils; >> /** >> * Renders an HTML element with an href @@ -146,6 +147,7 @@ >> * @param uri The portion of the url from the protocol name up to >>the query * string. >> * @return String An HTML <base> element. >> + * @since Struts 1.1 >> */ >> protected String renderBaseElement( >> String scheme, >> @@ -176,25 +178,13 @@ >> tag.append("\""); >> } >> - if (this.isXhtml()) { >> + if (RequestUtils.isXhtml(this.pageContext)) { >> tag.append(" />"); >> } else { >> tag.append(">"); >> } >> return tag.toString(); >> - } >> - >> - /** >> - * Returns true if the tag is in XHTML mode. >> - */ >> - protected boolean isXhtml() { >> - String xhtml = >> - (String) this.pageContext.getAttribute( >> - Globals.XHTML_KEY, >> - PageContext.PAGE_SCOPE); >> - >> - return "true".equalsIgnoreCase(xhtml); >> } >> /** >> 1.102 +17 -4 >>jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java >> Index: RequestUtils.java >> =================================================================== >> RCS file: >>/home/cvs/jakarta-struts/src/share/org/apache/struts/util/RequestUtils.java,v >> retrieving revision 1.101 >> retrieving revision 1.102 >> diff -u -r1.101 -r1.102 >> --- RequestUtils.java 10 May 2003 18:06:39 -0000 1.101 >> +++ RequestUtils.java 17 May 2003 01:56:51 -0000 1.102 >> @@ -1973,5 +1973,18 @@ >> return URLEncoder.encode(url); >> } >> + + /** >> + * Returns true if the custom tags are in XHTML mode. >> + * @since Struts 1.1 >> + */ >> + public static boolean isXhtml(PageContext pageContext) { >> + String xhtml = >> + (String) pageContext.getAttribute( >> + Globals.XHTML_KEY, >> + PageContext.PAGE_SCOPE); >> + >> + return "true".equalsIgnoreCase(xhtml); >> + } >> } >> > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org >For additional commands, e-mail: struts-dev-help@jakarta.apache.org > _________________________________________________________________ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail --------------------------------------------------------------------- To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: struts-dev-help@jakarta.apache.org