cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java esql.xsl
Date Mon, 13 Aug 2001 12:34:44 GMT
dims        01/08/13 05:34:44

  Modified:    src/org/apache/cocoon/components/language/markup/xsp/java
                        esql.xsl
  Log:
  Catch UnsupportedEncodingException and turn it into a RuntimeException.
  
  Revision  Changes    Path
  1.19      +13 -5     xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
  
  Index: esql.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- esql.xsl	2001/08/10 16:18:25	1.18
  +++ esql.xsl	2001/08/13 12:34:44	1.19
  @@ -1,5 +1,5 @@
   <?xml version="1.0"?>
  -<!-- $Id: esql.xsl,v 1.18 2001/08/10 16:18:25 dims Exp $-->
  +<!-- $Id: esql.xsl,v 1.19 2001/08/13 12:34:44 dims Exp $-->
   <!--
   
    ============================================================================
  @@ -322,6 +322,14 @@
           return new String(buffer);
         }
   
  +      private final String getStringFromByteArray(byte[] bytes, String encoding) {
  +        try {
  +            return new String(bytes,encoding);
  +        } catch (java.io.UnsupportedEncodingException uee) {
  +            throw new RuntimeException("Unsupported Encoding Exception: " + uee.getMessage());
  +        }
  +      }
  +
         <xsl:choose>
           <xsl:when test="$environment = 'cocoon1'">
           </xsl:when>
  @@ -758,11 +766,11 @@
                         </xsp:logic>
                       </xsp:element>
                       break;
  -		    
  +
                    case java.sql.Types.OTHER: // This is what Informix uses for Sets, Bags,
Lists
                       this._esql_printObject(_esql_query.resultset.getObject(_esql_i), xspAttr);
                       break;
  -		    
  +
                    default:
                       // standard type
                       <xsp:content>
  @@ -1080,8 +1088,8 @@
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="$resultset"/>.getBytes(<xsl:value-of select="$column-spec"/>)
  -      != null ? new String (<xsl:value-of select="$resultset"/>.getBytes
  -        (<xsl:value-of select="$column-spec"/>), <xsl:value-of select="$encoding"/>)
  +      != null ? getStringFromByteArray(<xsl:value-of select="$resultset"/>.getBytes
  +        (<xsl:value-of select="$column-spec"/>), <xsl:value-of select="$encoding"/>))
         : ""
       </xsl:otherwise>
     </xsl:choose>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message