[CONF] Confluence Changes in the last 24 hours

2009-08-03 Thread confluence
This is a daily summary of all recent changes in Confluence.

-
Updated Spaces:
-


Apache ESME (http://cwiki.apache.org/confluence/display/ESME)

Pages
-
REST API 2.0 - Design created by esjewett (08:27 AM)
http://cwiki.apache.org/confluence/display/ESME/REST+API+2.0+-+Design


Comments
http://cwiki.apache.org/confluence/display/ESME/REST+API+2.0+-+Design (6)

Apache Felix (http://cwiki.apache.org/confluence/display/FELIX)

Pages
-
Sigil Road Map created by dsav...@apache.org (06:04 AM)
http://cwiki.apache.org/confluence/display/FELIX/Sigil+Road+Map

Apache Felix Sigil Eclipse Features edited by  marrs  (06:50 AM)
http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Sigil+Eclipse+Features

Apache Felix Sigil edited by  dsav...@apache.org  (06:07 AM)
http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+Sigil

Sigil Contributing created by dsav...@apache.org (05:34 AM)
http://cwiki.apache.org/confluence/display/FELIX/Sigil+Contributing

Sigil Key Features created by dsav...@apache.org (05:08 AM)
http://cwiki.apache.org/confluence/display/FELIX/Sigil+Key+Features



Apache Wookie (http://cwiki.apache.org/confluence/display/WOOKIE)

Pages
-
Index edited by  scottbw  (09:58 AM)
http://cwiki.apache.org/confluence/display/WOOKIE/Index



-
Users
-

buy-viagra-online
http://cwiki.apache.org/confluence/display/~buy-viagra-online

Change your notification preferences: 
http://cwiki.apache.org/confluence/users/viewnotifications.action


Issues Opened: week of 2009-08-03

2009-08-03 Thread dblevins

Struts2 - Monday, August 3, 2009

  4 opened in last 7 days

[WW-3209] Select components do not allow setting attributes and JavaScript 
events on  tags
  - Type: Improvement
  - Reporter: Tim Stavenger
  - Components: [Other]
  - Affects Versions: []
  - http://issues.apache.org/struts/browse/WW-3209

[WW-3210] JFreeChart plugin not setting correct mime type
  - Type: Bug
  - Reporter: Chris D Searle
  - Components: [Plugin - JFreeChart]
  - Affects Versions: []
  - http://issues.apache.org/struts/browse/WW-3210

[WW-3206] instructions for jsonValidationWorkflowStack don't suggest how to 
avoid uploading files during the validation step
  - Type: Improvement
  - Reporter: Dale Newfield
  - Components: [Other, XML Validators]
  - Affects Versions: []
  - http://issues.apache.org/struts/browse/WW-3206

[WW-3207] Struts 2 submit tag is missing an "alt" attribute for type="image"
  - Type: Bug
  - Reporter: Dave Schindler
  - Components: [Plugin - Tags]
  - Affects Versions: []
  - http://issues.apache.org/struts/browse/WW-3207



svn commit: r800590 - /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/

2009-08-03 Thread musachy
Author: musachy
Date: Mon Aug  3 22:08:00 2009
New Revision: 800590

URL: http://svn.apache.org/viewvc?rev=800590&view=rev
Log:
copying jasper from /tc6.0.x/tags/TOMCAT_6_0_20/java/org/apache/jasper at 
r800587

Added:

struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/
  - copied from r800587, 
tomcat/tc6.0.x/tags/TOMCAT_6_0_20/java/org/apache/jasper/



svn commit: r800603 - /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/

2009-08-03 Thread musachy
Author: musachy
Date: Mon Aug  3 22:40:12 2009
New Revision: 800603

URL: http://svn.apache.org/viewvc?rev=800603&view=rev
Log:
removing jasper 6..going back to 5

Removed:

struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/



svn commit: r800607 - /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/jasper/

2009-08-03 Thread musachy
Author: musachy
Date: Mon Aug  3 22:47:10 2009
New Revision: 800607

URL: http://svn.apache.org/viewvc?rev=800607&view=rev
Log:
importing jasper from 
http://svn.apache.org/repos/asf/tomcat/jasper/tags/tc5.5.x/TOMCAT_5_5_28/ at 
r800603

Added:
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/jasper/
  - copied from r800604, 
tomcat/jasper/tags/tc5.5.x/TOMCAT_5_5_28/src/share/org/apache/jasper/



svn commit: r800608 - /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/jasper/

2009-08-03 Thread musachy
Author: musachy
Date: Mon Aug  3 22:49:18 2009
New Revision: 800608

URL: http://svn.apache.org/viewvc?rev=800608&view=rev
Log:
remove jasper...again

Removed:
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/jasper/



svn commit: r800614 [3/24] - in /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2: ./ jasper/ jasper/compiler/ jasper/compiler/tagplugin/ jasper/resources/ jasper/runtime/ jasp

2009-08-03 Thread musachy
Added: 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ELParser.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ELParser.java?rev=800614&view=auto
==
--- 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ELParser.java
 (added)
+++ 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ELParser.java
 Mon Aug  3 23:16:50 2009
@@ -0,0 +1,369 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.struts2.jasper.compiler;
+
+/**
+ * This class implements a parser for EL expressions.
+ *
+ * It takes strings of the form xxx${..}yyy${..}zzz etc, and turn it into
+ * a ELNode.Nodes.
+ *
+ * Currently, it only handles text outside ${..} and functions in ${ ..}.
+ *
+ * @author Kin-man Chung
+ */
+
+public class ELParser {
+
+private Token curToken;// current token
+private ELNode.Nodes expr;
+private ELNode.Nodes ELexpr;
+private int index;// Current index of the expression
+private String expression;// The EL expression
+private boolean escapeBS;// is '\' an escape char in text outside 
EL?
+
+private static final String reservedWords[] = {
+"and", "div", "empty", "eq", "false",
+"ge", "gt", "instanceof", "le", "lt", "mod",
+"ne", "not", "null", "or", "true"};
+
+public ELParser(String expression) {
+index = 0;
+this.expression = expression;
+expr = new ELNode.Nodes();
+}
+
+/**
+ * Parse an EL expression
+ * @param expression The input expression string of the form
+ *   Char* ('${' Char* '}')* Char*
+ * @return Parsed EL expression in ELNode.Nodes
+ */
+public static ELNode.Nodes parse(String expression) {
+ELParser parser = new ELParser(expression);
+while (parser.hasNextChar()) {
+String text = parser.skipUntilEL();
+if (text.length() > 0) {
+parser.expr.add(new ELNode.Text(text));
+}
+ELNode.Nodes elexpr = parser.parseEL();
+if (! elexpr.isEmpty()) {
+parser.expr.add(new ELNode.Root(elexpr));
+}
+}
+return parser.expr;
+}
+
+/**
+ * Parse an EL expression string '${...}'
+ *...@return An ELNode.Nodes representing the EL expression
+ * TODO: Currently only parsed into functions and text strings.  This
+ *   should be rewritten for a full parser.
+ */
+private ELNode.Nodes parseEL() {
+
+StringBuffer buf = new StringBuffer();
+ELexpr = new ELNode.Nodes();
+while (hasNext()) {
+curToken = nextToken();
+if (curToken instanceof Char) {
+if (curToken.toChar() == '}') {
+break;
+}
+buf.append(curToken.toChar());
+} else {
+// Output whatever is in buffer
+if (buf.length() > 0) {
+ELexpr.add(new ELNode.ELText(buf.toString()));
+}
+if (!parseFunction()) {
+ELexpr.add(new ELNode.ELText(curToken.toString()));
+}
+}
+}
+if (buf.length() > 0) {
+ELexpr.add(new ELNode.ELText(buf.toString()));
+}
+
+return ELexpr;
+}
+
+/**
+ * Parse for a function
+ * FunctionInvokation ::= (identifier ':')? identifier '('
+ *  (Expression (,Expression)*)? ')'
+ * Note: currently we don't parse arguments
+ */
+private boolean parseFunction() {
+if (! (curToken instanceof Id) || isELReserved(curToken.toString())) {
+return false;
+}
+String s1 = null; // Function prefix
+String s2 = curToken.toString();  // Function name
+int mark = getIndex();
+if (hasNext()) {
+Token t = nextToken();
+if (t.toChar() == ':'

svn commit: r800614 [8/24] - in /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2: ./ jasper/ jasper/compiler/ jasper/compiler/tagplugin/ jasper/resources/ jasper/runtime/ jasp

2009-08-03 Thread musachy
Added: 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java?rev=800614&view=auto
==
--- 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java
 (added)
+++ 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java
 Mon Aug  3 23:16:50 2009
@@ -0,0 +1,711 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.struts2.jasper.compiler;
+
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.io.CharArrayWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.ListIterator;
+import javax.servlet.jsp.tagext.PageData;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.AttributesImpl;
+import org.apache.struts2.jasper.JasperException;
+
+/**
+ * An implementation of javax.servlet.jsp.tagext.PageData which
+ * builds the XML view of a given page.
+ *
+ * The XML view is built in two passes:
+ *
+ * During the first pass, the FirstPassVisitor collects the attributes of the
+ * top-level jsp:root and those of the jsp:root elements of any included
+ * pages, and adds them to the jsp:root element of the XML view.
+ * In addition, any taglib directives are converted into xmlns: attributes and
+ * added to the jsp:root element of the XML view.
+ * This pass ignores any nodes other than JspRoot and TaglibDirective.
+ *
+ * During the second pass, the SecondPassVisitor produces the XML view, using
+ * the combined jsp:root attributes determined in the first pass and any
+ * remaining pages nodes (this pass ignores any JspRoot and TaglibDirective
+ * nodes).
+ *
+ * @author Jan Luehe
+ */
+class PageDataImpl extends PageData implements TagConstants {
+
+private static final String JSP_VERSION = "2.0";
+private static final String CDATA_START_SECTION = "\n";
+
+// string buffer used to build XML view
+private StringBuffer buf;
+
+/**
+ * Constructor.
+ *
+ * @param page the page nodes from which to generate the XML view
+ */
+public PageDataImpl(Node.Nodes page, Compiler compiler)
+throws JasperException {
+
+// First pass
+FirstPassVisitor firstPass = new FirstPassVisitor(page.getRoot(),
+  
compiler.getPageInfo());
+page.visit(firstPass);
+
+// Second pass
+buf = new StringBuffer();
+SecondPassVisitor secondPass
+= new SecondPassVisitor(page.getRoot(), buf, compiler,
+firstPass.getJspIdPrefix());
+page.visit(secondPass);
+}
+
+/**
+ * Returns the input stream of the XML view.
+ *
+ * @return the input stream of the XML view
+ */
+public InputStream getInputStream() {
+// Turn StringBuffer into InputStream
+try {
+return new ByteArrayInputStream(buf.toString().getBytes("UTF-8"));
+} catch (UnsupportedEncodingException uee) {
+// should never happen
+throw new RuntimeException(uee.toString());
+}
+}
+
+/*
+ * First-pass Visitor for JspRoot nodes (representing jsp:root elements)
+ * and TablibDirective nodes, ignoring any other nodes.
+ *
+ * The purpose of this Visitor is to collect the attributes of the
+ * top-level jsp:root and those of the jsp:root elements of any included
+ * pages, and add them to the jsp:root element of the XML view.
+ * In addition, this Visitor converts any taglib directives into xmlns:
+ * attributes and adds them to the jsp:root element of the XML view.
+ */
+static class FirstPassVisitor
+extends Node.Visitor implements TagConstants {
+
+private Node.Root root;
+private AttributesImpl rootAttrs;
+private PageInfo pageInfo;
+
+// Prefix for the 'id' attribute
+private String jspIdPrefix;
+
+   

svn commit: r800614 [12/24] - in /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2: ./ jasper/ jasper/compiler/ jasper/compiler/tagplugin/ jasper/resources/ jasper/runtime/ jas

2009-08-03 Thread musachy
Added: 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TldLocationsCache.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TldLocationsCache.java?rev=800614&view=auto
==
--- 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TldLocationsCache.java
 (added)
+++ 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TldLocationsCache.java
 Mon Aug  3 23:16:50 2009
@@ -0,0 +1,554 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.struts2.jasper.compiler;
+
+import java.io.InputStream;
+import java.net.JarURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLConnection;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import org.xml.sax.InputSource;
+
+import javax.servlet.ServletContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.jasper.Constants;
+import org.apache.struts2.jasper.JasperException;
+import org.apache.struts2.jasper.xmlparser.ParserUtils;
+import org.apache.struts2.jasper.xmlparser.TreeNode;
+
+/**
+ * A container for all tag libraries that are defined "globally"
+ * for the web application.
+ * 
+ * Tag Libraries can be defined globally in one of two ways:
+ *   1. Via  elements in web.xml:
+ *  the uri and location of the tag-library are specified in
+ *  the  element.
+ *   2. Via packaged jar files that contain .tld files
+ *  within the META-INF directory, or some subdirectory
+ *  of it. The taglib is 'global' if it has the 
+ *  element defined.
+ *
+ * A mapping between the taglib URI and its associated TaglibraryInfoImpl
+ * is maintained in this container.
+ * Actually, that's what we'd like to do. However, because of the
+ * way the classes TagLibraryInfo and TagInfo have been defined,
+ * it is not currently possible to share an instance of TagLibraryInfo
+ * across page invocations. A bug has been submitted to the spec lead.
+ * In the mean time, all we do is save the 'location' where the
+ * TLD associated with a taglib URI can be found.
+ *
+ * When a JSP page has a taglib directive, the mappings in this container
+ * are first searched (see method getLocation()).
+ * If a mapping is found, then the location of the TLD is returned.
+ * If no mapping is found, then the uri specified
+ * in the taglib directive is to be interpreted as the location for
+ * the TLD of this tag library.
+ *
+ * @author Pierre Delisle
+ * @author Jan Luehe
+ */
+
+public class TldLocationsCache {
+
+// Logger
+private Log log = LogFactory.getLog(TldLocationsCache.class);
+
+/**
+ * The types of URI one may specify for a tag library
+ */
+public static final int ABS_URI = 0;
+public static final int ROOT_REL_URI = 1;
+public static final int NOROOT_REL_URI = 2;
+
+private static final String WEB_XML = "/WEB-INF/web.xml";
+private static final String FILE_PROTOCOL = "file:";
+private static final String JAR_FILE_SUFFIX = ".jar";
+
+// Names of JARs that are known not to contain any TLDs
+private static HashSet noTldJars;
+
+/**
+ * The mapping of the 'global' tag library URI to the location (resource
+ * path) of the TLD associated with that tag library. The location is
+ * returned as a String array:
+ *[0] The location
+ *[1] If the location is a jar file, this is the location of the tld.
+ */
+private Hashtable mappings;
+
+private boolean initialized;
+private ServletContext ctxt;
+private boolean redeployMode;
+
+//*
+// Constructor and Initilizations
+
+/*
+ * Initializes the set of JARs that are known not to contain a

svn commit: r800614 [23/24] - in /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2: ./ jasper/ jasper/compiler/ jasper/compiler/tagplugin/ jasper/resources/ jasper/runtime/ jas

2009-08-03 Thread musachy
Added: 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLChar.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLChar.java?rev=800614&view=auto
==
--- 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLChar.java
 (added)
+++ 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLChar.java
 Mon Aug  3 23:16:50 2009
@@ -0,0 +1,1031 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation and was
+ * originally based on software copyright (c) 1999, International
+ * Business Machines, Inc., http://www.apache.org.  For more
+ * information on the Apache Software Foundation, please see
+ * .
+ */
+
+package org.apache.struts2.jasper.xmlparser;
+
+import java.util.Arrays;
+
+/**
+ * This class defines the basic XML character properties. The data
+ * in this class can be used to verify that a character is a valid
+ * XML character or if the character is a space, name start, or name
+ * character.
+ * 
+ * A series of convenience methods are supplied to ease the burden
+ * of the developer. Because inlining the checks can improve per
+ * character performance, the tables of character properties are
+ * public. Using the character as an index into the CHARS
+ * array and applying the appropriate mask flag (e.g.
+ * MASK_VALID), yields the same results as calling the
+ * convenience methods. There is one exception: check the comments
+ * for the isValid method for details.
+ *
+ * @author Glenn Marcy, IBM
+ * @author Andy Clark, IBM
+ * @author Eric Ye, IBM
+ * @author Arnaud  Le Hors, IBM
+ * @author Michael Glavassevich, IBM
+ * @author Rahul Srivastava, Sun Microsystems Inc.
+ *
+ * @version $Id: XMLChar.java 466606 2006-10-21 23:07:12Z markt $
+ */
+public class XMLChar {
+
+//
+// Constants
+//
+
+/** Character flags. */
+private static final byte[] CHARS = new byte[1 << 16];
+
+/** Valid character mask. */
+public static final int MASK_VALID = 0x01;
+
+/** Space character mask. */
+public static final int MASK_SPACE = 0x02;
+
+/** Name start character mask. */
+public static final int MASK_NAME_START = 0x04;
+
+/** Name character mask. */
+public static final int MASK_NAME = 0x08;
+
+/** Pubid character mask. */
+public static final int MASK_PUBID = 0x10;
+
+/** 
+ * Content character mask. Special characters are those that can
+ * be considered the start of markup, such as '<' and '&'. 
+ * The various newline characters are considered special as well.
+ * All other valid XML characters can be considered content.
+ * 
+ * This is an optimization for the inner loop of character scanning.
+ */
+public static final int MASK_CONTENT = 0x20;
+
+/** NCName start character mask. */
+public static final int MASK_NCNAME_START = 0x40;
+
+/** NCName character mask. */
+public static final int MASK_NCNAME = 0x80;
+
+//
+// Static initialization
+//
+
+static {
+
+// Initializing the Character Flag Array
+// Code generated by: XMLCharGenerator.
+
+CHARS[9] = 35;
+CHARS[10] = 19;
+CHARS[13] = 19;
+CHARS[32] = 51;
+CHARS[33] = 49;
+CHARS[34] = 33;
+Arrays.fill(CHARS, 35, 38, (byte) 49 ); // Fill 3 of value (byte) 49
+CHARS[38] = 1;
+Arrays.fill(CHARS, 39, 45, (byte) 49 ); // Fill 6 of value (byte) 49
+Arrays.fill(CHARS, 45, 47, (byte) -71 ); // Fill 2 of value (byte) -71
+CHARS[47] = 49;
+Arrays.fill(CHARS, 48, 58, (byte) -71 ); // Fill 10 of value (byte) -71
+CHARS[58] = 61;
+CHARS[59] = 49;
+CHARS[60] = 1;
+CHARS[61] = 49;
+CHARS[62] = 33;
+Arrays.fill(CHARS, 63, 65, (by

svn commit: r800614 [22/24] - in /struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2: ./ jasper/ jasper/compiler/ jasper/compiler/tagplugin/ jasper/resources/ jasper/runtime/ jas

2009-08-03 Thread musachy
Added: 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/UCSReader.java
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/UCSReader.java?rev=800614&view=auto
==
--- 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/UCSReader.java
 (added)
+++ 
struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/UCSReader.java
 Mon Aug  3 23:16:50 2009
@@ -0,0 +1,301 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.struts2.jasper.xmlparser;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.Reader;
+
+/** 
+ * Reader for UCS-2 and UCS-4 encodings.
+ * (i.e., encodings from ISO-10646-UCS-(2|4)).
+ *
+ * @author Neil Graham, IBM
+ *
+ * @version $Id: UCSReader.java 466606 2006-10-21 23:07:12Z markt $
+ */
+public class UCSReader extends Reader {
+
+private org.apache.commons.logging.Log log=
+org.apache.commons.logging.LogFactory.getLog( UCSReader.class );
+
+//
+// Constants
+//
+
+/** Default byte buffer size (8192, larger than that of ASCIIReader
+ * since it's reasonable to surmise that the average UCS-4-encoded
+ * file should be 4 times as large as the average ASCII-encoded file). 
+ */
+public static final int DEFAULT_BUFFER_SIZE = 8192;
+
+public static final short UCS2LE = 1;
+public static final short UCS2BE = 2;
+public static final short UCS4LE = 4;
+public static final short UCS4BE = 8;
+
+//
+// Data
+//
+
+/** Input stream. */
+protected InputStream fInputStream;
+
+/** Byte buffer. */
+protected byte[] fBuffer;
+
+// what kind of data we're dealing with
+protected short fEncoding;
+
+//
+// Constructors
+//
+
+/** 
+ * Constructs an ASCII reader from the specified input stream 
+ * using the default buffer size.  The Endian-ness and whether this is
+ * UCS-2 or UCS-4 needs also to be known in advance.
+ *
+ * @param inputStream The input stream.
+ * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE.
+ */
+public UCSReader(InputStream inputStream, short encoding) {
+this(inputStream, DEFAULT_BUFFER_SIZE, encoding);
+} // (InputStream, short)
+
+/** 
+ * Constructs an ASCII reader from the specified input stream 
+ * and buffer size.  The Endian-ness and whether this is
+ * UCS-2 or UCS-4 needs also to be known in advance.
+ *
+ * @param inputStream The input stream.
+ * @param sizeThe initial buffer size.
+ * @param encoding One of UCS2LE, UCS2BE, UCS4LE or UCS4BE.
+ */
+public UCSReader(InputStream inputStream, int size, short encoding) {
+fInputStream = inputStream;
+fBuffer = new byte[size];
+fEncoding = encoding;
+} // (InputStream,int,short)
+
+//
+// Reader methods
+//
+
+/**
+ * Read a single character.  This method will block until a character is
+ * available, an I/O error occurs, or the end of the stream is reached.
+ *
+ *  Subclasses that intend to support efficient single-character input
+ * should override this method.
+ *
+ * @return The character read, as an integer in the range 0 to 127
+ * (0x00-0x7f), or -1 if the end of the stream has
+ * been reached
+ *
+ * @exception  IOException  If an I/O error occurs
+ */
+public int read() throws IOException { 
+int b0 = fInputStream.read() & 0xff;
+if (b0 == 0xff)
+return -1;
+int b1 = fInputStream.read() & 0xff;
+if (b1 == 0xff)
+return -1;
+if(fEncoding >=4) {
+int b2 = fInputStream.read() & 0xff;
+if (b2 == 0xff)
+return -1;
+int b3 = fInputStream.read() & 0xff;
+if (b3 == 0xff)
+return -1;
+if (log.isDebugEnabled())
+log.debug("b0 is " + (b0 & 0xff) + " b1 " + (b1 & 0xff) +