You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/10/22 23:18:07 UTC
svn commit: r1187803 [4/6] - in /tomcat/trunk/java/org/apache/jasper: ./
compiler/ compiler/tagplugin/ el/ resources/ runtime/ security/ servlet/
tagplugins/jstl/ tagplugins/jstl/core/ util/ xmlparser/
Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspFragmentHelper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspFragmentHelper.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspFragmentHelper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspFragmentHelper.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -33,17 +33,17 @@ import javax.servlet.jsp.tagext.JspTag;
*
* @author Mark Roth
*/
-public abstract class JspFragmentHelper
- extends JspFragment
+public abstract class JspFragmentHelper
+ extends JspFragment
{
-
+
protected int discriminator;
protected JspContext jspContext;
protected PageContext _jspx_page_context;
protected JspTag parentTag;
- public JspFragmentHelper( int discriminator, JspContext jspContext,
- JspTag parentTag )
+ public JspFragmentHelper( int discriminator, JspContext jspContext,
+ JspTag parentTag )
{
this.discriminator = discriminator;
this.jspContext = jspContext;
@@ -53,14 +53,14 @@ public abstract class JspFragmentHelper
}
this.parentTag = parentTag;
}
-
+
@Override
public JspContext getJspContext() {
return this.jspContext;
}
-
+
public JspTag getParentTag() {
return this.parentTag;
}
-
+
}
Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -43,7 +43,7 @@ import org.apache.jasper.compiler.Locali
/**
* Bunch of util methods that are used by code generated for useBean,
- * getProperty and setProperty.
+ * getProperty and setProperty.
*
* The __begin, __end stuff is there so that the JSP engine can
* actually parse this file and inline them if people don't want
@@ -54,7 +54,7 @@ import org.apache.jasper.compiler.Locali
* @author Shawn Bayern
*/
public class JspRuntimeLibrary {
-
+
protected static class PrivilegedIntrospectHelper
implements PrivilegedExceptionAction<Void> {
@@ -76,7 +76,7 @@ public class JspRuntimeLibrary {
this.param = param;
this.ignoreMethodNF = ignoreMethodNF;
}
-
+
@Override
public Void run() throws JasperException {
internalIntrospecthelper(
@@ -103,7 +103,7 @@ public class JspRuntimeLibrary {
/*
* The only place that sets JSP_EXCEPTION is
* PageContextImpl.handlePageException(). It really should set
- * SERVLET_EXCEPTION, but that would interfere with the
+ * SERVLET_EXCEPTION, but that would interfere with the
* ErrorReportValve. Therefore, if JSP_EXCEPTION is set, we
* need to set SERVLET_EXCEPTION.
*/
@@ -189,7 +189,7 @@ public class JspRuntimeLibrary {
} else if (target == Character.class) {
if (isNullOrEmpty)
return Character.valueOf((char) 0);
- else
+ else
return Character.valueOf(s.charAt(0));
} else if (target == Double.class) {
if (isNullOrEmpty)
@@ -223,8 +223,8 @@ public class JspRuntimeLibrary {
// __begin convertMethod
public static Object convert(String propertyName, String s, Class<?> t,
- Class<?> propertyEditorClass)
- throws JasperException
+ Class<?> propertyEditorClass)
+ throws JasperException
{
try {
if (s == null) {
@@ -284,7 +284,7 @@ public class JspRuntimeLibrary {
}
}
// __end introspectMethod
-
+
// __begin introspecthelperMethod
public static void introspecthelper(Object bean, String prop,
String value, ServletRequest request,
@@ -309,7 +309,7 @@ public class JspRuntimeLibrary {
private static void internalIntrospecthelper(Object bean, String prop,
String value, ServletRequest request,
- String param, boolean ignoreMethodNF)
+ String param, boolean ignoreMethodNF)
throws JasperException
{
Method method = null;
@@ -344,7 +344,7 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { values });
} else {
createTypedArray (prop, bean, method, values, t,
- propertyEditorClass);
+ propertyEditorClass);
}
} else {
if(value == null || (param != null && value.equals(""))) return;
@@ -372,7 +372,7 @@ public class JspRuntimeLibrary {
}
}
// __end introspecthelperMethod
-
+
//-------------------------------------------------------------------
// functions to convert builtin Java data types to string.
//-------------------------------------------------------------------
@@ -519,7 +519,7 @@ public class JspRuntimeLibrary {
} else {
Object[] tmpval = new Integer[values.length];
for (int i=0; i<values.length; i++) {
- tmpval[i] =
+ tmpval[i] =
getValueFromPropertyEditorManager(
t, propertyName, values[i]);
}
@@ -539,10 +539,10 @@ public class JspRuntimeLibrary {
public static String escapeQueryString(String unescString) {
if ( unescString == null )
return null;
-
+
String escString = "";
String shellSpChars = "&;`'\"|*?~<>^()[]{}$\\\n";
-
+
for(int index=0; index<unescString.length(); index++) {
char nextChar = unescString.charAt(index);
@@ -581,7 +581,7 @@ public class JspRuntimeLibrary {
{
try {
Method method = getWriteMethod(bean.getClass(), prop);
- method.invoke(bean, new Object[] {
+ method.invoke(bean, new Object[] {
pageContext.getExpressionEvaluator().evaluate(
expression,
method.getParameterTypes()[0],
@@ -625,7 +625,7 @@ public class JspRuntimeLibrary {
throw new JasperException(ex);
}
}
-
+
public static void handleSetProperty(Object bean, String prop,
int value)
throws JasperException
@@ -635,9 +635,9 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Integer.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
+ }
}
-
+
public static void handleSetProperty(Object bean, String prop,
short value)
throws JasperException
@@ -647,9 +647,9 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Short.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
+ }
}
-
+
public static void handleSetProperty(Object bean, String prop,
long value)
throws JasperException
@@ -659,9 +659,9 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Long.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
- }
-
+ }
+ }
+
public static void handleSetProperty(Object bean, String prop,
double value)
throws JasperException
@@ -671,9 +671,9 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Double.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
+ }
}
-
+
public static void handleSetProperty(Object bean, String prop,
float value)
throws JasperException
@@ -683,9 +683,9 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Float.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
+ }
}
-
+
public static void handleSetProperty(Object bean, String prop,
char value)
throws JasperException
@@ -695,7 +695,7 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Character.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
+ }
}
public static void handleSetProperty(Object bean, String prop,
@@ -707,9 +707,9 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Byte.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
+ }
}
-
+
public static void handleSetProperty(Object bean, String prop,
boolean value)
throws JasperException
@@ -719,12 +719,12 @@ public class JspRuntimeLibrary {
method.invoke(bean, new Object[] { Boolean.valueOf(value) });
} catch (Exception ex) {
throw new JasperException(ex);
- }
+ }
}
-
+
public static Method getWriteMethod(Class<?> beanClass, String prop)
throws JasperException {
- Method method = null;
+ Method method = null;
Class<?> type = null;
try {
java.beans.BeanInfo info
@@ -739,7 +739,7 @@ public class JspRuntimeLibrary {
break;
}
}
- } else {
+ } else {
// just in case introspection silently fails.
throw new JasperException(
Localizer.getMessage("jsp.error.beans.nobeaninfo",
@@ -768,7 +768,7 @@ public class JspRuntimeLibrary {
public static Method getReadMethod(Class<?> beanClass, String prop)
throws JasperException {
- Method method = null;
+ Method method = null;
Class<?> type = null;
try {
java.beans.BeanInfo info
@@ -783,7 +783,7 @@ public class JspRuntimeLibrary {
break;
}
}
- } else {
+ } else {
// just in case introspection silently fails.
throw new JasperException(
Localizer.getMessage("jsp.error.beans.nobeaninfo",
@@ -812,8 +812,8 @@ public class JspRuntimeLibrary {
public static Object getValueFromBeanInfoPropertyEditor(
Class<?> attrClass, String attrName, String attrValue,
- Class<?> propertyEditorClass)
- throws JasperException
+ Class<?> propertyEditorClass)
+ throws JasperException
{
try {
PropertyEditor pe =
@@ -829,11 +829,11 @@ public class JspRuntimeLibrary {
}
public static Object getValueFromPropertyEditorManager(
- Class<?> attrClass, String attrName, String attrValue)
- throws JasperException
+ Class<?> attrClass, String attrName, String attrValue)
+ throws JasperException
{
try {
- PropertyEditor propEditor =
+ PropertyEditor propEditor =
PropertyEditorManager.findEditor(attrClass);
if (propEditor != null) {
propEditor.setAsText(attrValue);
@@ -877,13 +877,13 @@ public class JspRuntimeLibrary {
String pathInfo = (String)
request.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO);
if (pathInfo == null) {
- if (uri.lastIndexOf('/') >= 0)
+ if (uri.lastIndexOf('/') >= 0)
uri = uri.substring(0, uri.lastIndexOf('/'));
}
}
else {
uri = hrequest.getServletPath();
- if (uri.lastIndexOf('/') >= 0)
+ if (uri.lastIndexOf('/') >= 0)
uri = uri.substring(0, uri.lastIndexOf('/'));
}
return uri + '/' + relativePath;
@@ -935,7 +935,7 @@ public class JspRuntimeLibrary {
* in J2SDK1.4, and should be removed if the only platform supported
* is 1.4 or higher.
* @param s The String to be URL encoded.
- * @param enc The character encoding
+ * @param enc The character encoding
* @return The URL encoded String
*/
public static String URLEncode(String s, String enc) {
@@ -945,7 +945,7 @@ public class JspRuntimeLibrary {
}
if (enc == null) {
- enc = "ISO-8859-1"; // The default request encoding
+ enc = "ISO-8859-1"; // The default request encoding
}
StringBuilder out = new StringBuilder(s.length());
@@ -957,7 +957,7 @@ public class JspRuntimeLibrary {
// Use the default encoding?
writer = new OutputStreamWriter(buf);
}
-
+
for (int i = 0; i < s.length(); i++) {
int c = s.charAt(i);
if (c == ' ') {
Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspSourceDependent.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspSourceDependent.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspSourceDependent.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspSourceDependent.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspWriterImpl.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -32,29 +32,29 @@ import org.apache.jasper.security.Securi
/**
* Write text to a character-output stream, buffering characters so as
* to provide for the efficient writing of single characters, arrays,
- * and strings.
+ * and strings.
+ *
+ * Provide support for discarding for the output that has been
+ * buffered.
*
- * Provide support for discarding for the output that has been
- * buffered.
- *
* This needs revisiting when the buffering problems in the JSP spec
- * are fixed -akv
+ * are fixed -akv
*
* @author Anil K. Vijendran
*/
public class JspWriterImpl extends JspWriter {
-
+
private Writer out;
- private ServletResponse response;
+ private ServletResponse response;
private char cb[];
private int nextChar;
private boolean flushed = false;
private boolean closed = false;
-
+
public JspWriterImpl() {
super( Constants.DEFAULT_BUFFER_SIZE, true );
}
-
+
/**
* Create a buffered character-output stream that uses a default-sized
* output buffer.
@@ -64,7 +64,7 @@ public class JspWriterImpl extends JspWr
public JspWriterImpl(ServletResponse response) {
this(response, Constants.DEFAULT_BUFFER_SIZE, true);
}
-
+
/**
* Create a new buffered character-output stream that uses an output
* buffer of the given size.
@@ -74,7 +74,7 @@ public class JspWriterImpl extends JspWr
*
* @exception IllegalArgumentException If sz is <= 0
*/
- public JspWriterImpl(ServletResponse response, int sz,
+ public JspWriterImpl(ServletResponse response, int sz,
boolean autoFlush) {
super(sz, autoFlush);
if (sz < 0)
@@ -83,7 +83,7 @@ public class JspWriterImpl extends JspWr
cb = sz == 0 ? null : new char[sz];
nextChar = 0;
}
-
+
void init( ServletResponse response, int sz, boolean autoFlush ) {
this.response= response;
if( sz > 0 && ( cb == null || sz > cb.length ) )
@@ -92,7 +92,7 @@ public class JspWriterImpl extends JspWr
this.autoFlush=autoFlush;
this.bufferSize=sz;
}
-
+
/** Package-level access
*/
void recycle() {
@@ -102,7 +102,7 @@ public class JspWriterImpl extends JspWr
nextChar = 0;
response = null;
}
-
+
/**
* Flush the output buffer to the underlying character stream, without
* flushing the stream itself. This method is non-private only so that it
@@ -119,26 +119,26 @@ public class JspWriterImpl extends JspWr
out.write(cb, 0, nextChar);
nextChar = 0;
}
-
+
private void initOut() throws IOException {
if (out == null) {
out = response.getWriter();
}
}
-
+
private String getLocalizeMessage(final String message){
if (SecurityUtil.isPackageProtectionEnabled()){
return AccessController.doPrivileged(new PrivilegedAction<String>(){
@Override
public String run(){
- return Localizer.getMessage(message);
+ return Localizer.getMessage(message);
}
});
} else {
return Localizer.getMessage(message);
}
}
-
+
/**
* Discard the output buffer.
*/
@@ -154,7 +154,7 @@ public class JspWriterImpl extends JspWr
ensureOpen();
nextChar = 0;
}
-
+
@Override
public void clearBuffer() throws IOException {
if (bufferSize == 0)
@@ -163,11 +163,11 @@ public class JspWriterImpl extends JspWr
ensureOpen();
nextChar = 0;
}
-
+
private final void bufferOverflow() throws IOException {
throw new IOException(getLocalizeMessage("jsp.error.overflow"));
}
-
+
/**
* Flush the stream.
*
@@ -179,7 +179,7 @@ public class JspWriterImpl extends JspWr
out.flush();
}
}
-
+
/**
* Close the stream.
*
@@ -195,7 +195,7 @@ public class JspWriterImpl extends JspWr
out = null;
closed = true;
}
-
+
/**
* @return the number of bytes unused in the buffer
*/
@@ -203,14 +203,14 @@ public class JspWriterImpl extends JspWr
public int getRemaining() {
return bufferSize - nextChar;
}
-
+
/** check to make sure that the stream has not been closed */
private void ensureOpen() throws IOException {
if (response == null || closed)
throw new IOException("Stream closed");
}
-
-
+
+
/**
* Write a single character.
*/
@@ -230,7 +230,7 @@ public class JspWriterImpl extends JspWr
cb[nextChar++] = (char) c;
}
}
-
+
/**
* Our own little min method, to avoid loading java.lang.Math if we've run
* out of file descriptors and we're trying to print a stack trace.
@@ -239,7 +239,7 @@ public class JspWriterImpl extends JspWr
if (a < b) return a;
return b;
}
-
+
/**
* Write a portion of an array of characters.
*
@@ -255,24 +255,24 @@ public class JspWriterImpl extends JspWr
* @param len Number of characters to write
*/
@Override
- public void write(char cbuf[], int off, int len)
- throws IOException
+ public void write(char cbuf[], int off, int len)
+ throws IOException
{
ensureOpen();
-
+
if (bufferSize == 0) {
initOut();
out.write(cbuf, off, len);
return;
}
-
+
if ((off < 0) || (off > cbuf.length) || (len < 0) ||
((off + len) > cbuf.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return;
- }
-
+ }
+
if (len >= bufferSize) {
/* If the request length exceeds the size of the output buffer,
flush the buffer and then write the data directly. In this
@@ -285,22 +285,22 @@ public class JspWriterImpl extends JspWr
out.write(cbuf, off, len);
return;
}
-
+
int b = off, t = off + len;
while (b < t) {
int d = min(bufferSize - nextChar, t - b);
System.arraycopy(cbuf, b, cb, nextChar, d);
b += d;
nextChar += d;
- if (nextChar >= bufferSize)
+ if (nextChar >= bufferSize)
if (autoFlush)
flushBuffer();
else
bufferOverflow();
}
-
+
}
-
+
/**
* Write an array of characters. This method cannot be inherited from the
* Writer class because it must suppress I/O exceptions.
@@ -309,7 +309,7 @@ public class JspWriterImpl extends JspWr
public void write(char buf[]) throws IOException {
write(buf, 0, buf.length);
}
-
+
/**
* Write a portion of a String.
*
@@ -331,14 +331,14 @@ public class JspWriterImpl extends JspWr
s.getChars(b, b + d, cb, nextChar);
b += d;
nextChar += d;
- if (nextChar >= bufferSize)
+ if (nextChar >= bufferSize)
if (autoFlush)
flushBuffer();
else
bufferOverflow();
}
}
-
+
/**
* Write a string. This method cannot be inherited from the Writer class
* because it must suppress I/O exceptions.
@@ -353,10 +353,10 @@ public class JspWriterImpl extends JspWr
write(s, 0, s.length());
}
}
-
-
+
+
static String lineSeparator = System.getProperty("line.separator");
-
+
/**
* Write a line separator. The line separator string is defined by the
* system property <tt>line.separator</tt>, and is not necessarily a single
@@ -364,15 +364,15 @@ public class JspWriterImpl extends JspWr
*
* @exception IOException If an I/O error occurs
*/
-
+
@Override
public void newLine() throws IOException {
write(lineSeparator);
}
-
-
+
+
/* Methods that do not terminate lines */
-
+
/**
* Print a boolean value. The string produced by <code>{@link
* java.lang.String#valueOf(boolean)}</code> is translated into bytes
@@ -386,7 +386,7 @@ public class JspWriterImpl extends JspWr
public void print(boolean b) throws IOException {
write(b ? "true" : "false");
}
-
+
/**
* Print a character. The character is translated into one or more bytes
* according to the platform's default character encoding, and these bytes
@@ -399,7 +399,7 @@ public class JspWriterImpl extends JspWr
public void print(char c) throws IOException {
write(String.valueOf(c));
}
-
+
/**
* Print an integer. The string produced by <code>{@link
* java.lang.String#valueOf(int)}</code> is translated into bytes according
@@ -413,7 +413,7 @@ public class JspWriterImpl extends JspWr
public void print(int i) throws IOException {
write(String.valueOf(i));
}
-
+
/**
* Print a long integer. The string produced by <code>{@link
* java.lang.String#valueOf(long)}</code> is translated into bytes
@@ -427,7 +427,7 @@ public class JspWriterImpl extends JspWr
public void print(long l) throws IOException {
write(String.valueOf(l));
}
-
+
/**
* Print a floating-point number. The string produced by <code>{@link
* java.lang.String#valueOf(float)}</code> is translated into bytes
@@ -441,7 +441,7 @@ public class JspWriterImpl extends JspWr
public void print(float f) throws IOException {
write(String.valueOf(f));
}
-
+
/**
* Print a double-precision floating-point number. The string produced by
* <code>{@link java.lang.String#valueOf(double)}</code> is translated into
@@ -455,7 +455,7 @@ public class JspWriterImpl extends JspWr
public void print(double d) throws IOException {
write(String.valueOf(d));
}
-
+
/**
* Print an array of characters. The characters are converted into bytes
* according to the platform's default character encoding, and these bytes
@@ -470,7 +470,7 @@ public class JspWriterImpl extends JspWr
public void print(char s[]) throws IOException {
write(s);
}
-
+
/**
* Print a string. If the argument is <code>null</code> then the string
* <code>"null"</code> is printed. Otherwise, the string's characters are
@@ -487,7 +487,7 @@ public class JspWriterImpl extends JspWr
}
write(s);
}
-
+
/**
* Print an object. The string produced by the <code>{@link
* java.lang.String#valueOf(Object)}</code> method is translated into bytes
@@ -501,9 +501,9 @@ public class JspWriterImpl extends JspWr
public void print(Object obj) throws IOException {
write(String.valueOf(obj));
}
-
+
/* Methods that do terminate lines */
-
+
/**
* Terminate the current line by writing the line separator string. The
* line separator string is defined by the system property
@@ -512,13 +512,13 @@ public class JspWriterImpl extends JspWr
*
* Need to change this from PrintWriter because the default
* println() writes to the sink directly instead of through the
- * write method...
+ * write method...
*/
@Override
public void println() throws IOException {
newLine();
}
-
+
/**
* Print a boolean value and then terminate the line. This method behaves
* as though it invokes <code>{@link #print(boolean)}</code> and then
@@ -529,7 +529,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print a character and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(char)}</code> and then <code>{@link
@@ -540,7 +540,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print an integer and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(int)}</code> and then <code>{@link
@@ -551,7 +551,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print a long integer and then terminate the line. This method behaves
* as though it invokes <code>{@link #print(long)}</code> and then
@@ -562,7 +562,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print a floating-point number and then terminate the line. This method
* behaves as though it invokes <code>{@link #print(float)}</code> and then
@@ -573,7 +573,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print a double-precision floating-point number and then terminate the
* line. This method behaves as though it invokes <code>{@link
@@ -584,7 +584,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print an array of characters and then terminate the line. This method
* behaves as though it invokes <code>{@link #print(char[])}</code> and then
@@ -595,7 +595,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print a String and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(String)}</code> and then
@@ -606,7 +606,7 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
/**
* Print an Object and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(Object)}</code> and then
@@ -617,5 +617,5 @@ public class JspWriterImpl extends JspWr
print(x);
println();
}
-
+
}
Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -59,7 +59,7 @@ import org.apache.jasper.util.Enumerator
/**
* Implementation of the PageContext class from the JSP spec. Also doubles as a
* VariableResolver for the EL.
- *
+ *
* @author Anil K. Vijendran
* @author Larry Cable
* @author Hans Bergsten
@@ -70,7 +70,7 @@ import org.apache.jasper.util.Enumerator
*/
public class PageContextImpl extends PageContext {
- private static final JspFactory jspf = JspFactory.getDefaultFactory();
+ private static final JspFactory jspf = JspFactory.getDefaultFactory();
private BodyContentImpl[] outs;
@@ -96,12 +96,12 @@ public class PageContextImpl extends Pag
private transient ServletResponse response;
private transient HttpSession session;
-
+
private transient ELContextImpl elContext;
private boolean isIncluded;
-
-
+
+
// initial output stream
private transient JspWriter out;
@@ -137,7 +137,7 @@ public class PageContextImpl extends Pag
this.errorPageURL = errorPageURL;
this.request = request;
this.response = response;
-
+
// initialize application context
this.applicationContext = JspApplicationContextImpl.getInstance(context);
@@ -611,7 +611,7 @@ public class PageContextImpl extends Pag
* Returns the exception associated with this page context, if any. <p/>
* Added wrapping for Throwables to avoid ClassCastException: see Bugzilla
* 31171 for details.
- *
+ *
* @return The Exception associated with this page context, if any.
*/
@Override
@@ -940,7 +940,7 @@ public class PageContextImpl extends Pag
* go away once the EL interpreter moves out of JSTL and into its own
* project. For now, this is necessary because the standard machinery is too
* slow.
- *
+ *
* @param expression
* The expression to be evaluated
* @param expectedType
Modified: tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.jasper.Constants;
*
* @author Jan Luehe
* @author Costin Manolache
- *
+ *
* @deprecated Use of ThreadLocals is likely to trigger memory leaks. Use
* TagHandlerPool. Will be removed in Tomcat 8.0.x.
*/
@@ -126,7 +126,7 @@ public class PerThreadTagHandlerPool ext
* Calls the release() method of all tag handlers in this tag handler pool.
*/
@Override
- public void release() {
+ public void release() {
Enumeration<PerThreadData> enumeration = perThreadDataVector.elements();
while (enumeration.hasMoreElements()) {
PerThreadData ptd = enumeration.nextElement();
Modified: tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/ProtectedFunctionMapper.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.jasper.security.Securi
/**
* Maps EL functions to their Java method counterparts. Keeps the actual Method
* objects protected so that JSP pages can't indirectly do reflection.
- *
+ *
* @author Mark Roth
* @author Kin-man Chung
*/
@@ -59,7 +59,7 @@ public final class ProtectedFunctionMapp
* retrieve an instance of the ProtectedFunctionMapper. This is necessary
* since generated code does not have access to create instances of classes
* in this package.
- *
+ *
* @return A new protected function mapper.
*/
public static ProtectedFunctionMapper getInstance() {
@@ -82,7 +82,7 @@ public final class ProtectedFunctionMapp
/**
* Stores a mapping from the given EL function prefix and name to the given
* Java method.
- *
+ *
* @param fnQName
* The EL function qualified name (including prefix)
* @param c
@@ -128,7 +128,7 @@ public final class ProtectedFunctionMapp
* Creates an instance for this class, and stores the Method for the given
* EL function prefix and name. This method is used for the case when there
* is only one function in the EL expression.
- *
+ *
* @param fnQName
* The EL function qualified name (including prefix)
* @param c
@@ -183,7 +183,7 @@ public final class ProtectedFunctionMapp
/**
* Resolves the specified local name and prefix into a Java.lang.Method.
* Returns null if the prefix and local name are not found.
- *
+ *
* @param prefix
* the prefix of the function
* @param localName
Modified: tomcat/trunk/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/ServletResponseWrapperInclude.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ public class ServletResponseWrapperInclu
private JspWriter jspWriter;
- public ServletResponseWrapperInclude(ServletResponse response,
+ public ServletResponseWrapperInclude(ServletResponse response,
JspWriter jspWriter) {
super((HttpServletResponse)response);
this.printWriter = new PrintWriter(jspWriter);
Modified: tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -28,7 +28,7 @@ import org.apache.tomcat.InstanceManager
/**
* Pool of tag handlers that can be reused.
- *
+ *
* @author Jan Luehe
*/
public class TagHandlerPool {
@@ -93,7 +93,7 @@ public class TagHandlerPool {
/**
* Gets the next available tag handler from this tag handler pool,
* instantiating one if this tag handler pool is empty.
- *
+ *
* @param handlerClass
* Tag handler class
* @return Reused or newly instantiated tag handler
@@ -129,7 +129,7 @@ public class TagHandlerPool {
* Adds the given tag handler to this tag handler pool, unless this tag
* handler pool has already reached its capacity, in which case the tag
* handler's release() method is called.
- *
+ *
* @param handler
* Tag handler to add to this tag handler pool
*/
Modified: tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java (original)
+++ tomcat/trunk/java/org/apache/jasper/security/SecurityClassLoad.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -48,7 +48,7 @@ public final class SecurityClassLoad {
"runtime.JspRuntimeLibrary");
loader.loadClass( basePackage +
"runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper");
-
+
loader.loadClass( basePackage +
"runtime.ServletResponseWrapperInclude");
loader.loadClass( basePackage +
@@ -61,47 +61,47 @@ public final class SecurityClassLoad {
loader.loadClass( basePackage +
"runtime.ProtectedFunctionMapper$1");
loader.loadClass( basePackage +
- "runtime.ProtectedFunctionMapper$2");
+ "runtime.ProtectedFunctionMapper$2");
loader.loadClass( basePackage +
"runtime.ProtectedFunctionMapper$3");
loader.loadClass( basePackage +
- "runtime.ProtectedFunctionMapper$4");
+ "runtime.ProtectedFunctionMapper$4");
loader.loadClass( basePackage +
- "runtime.PageContextImpl");
+ "runtime.PageContextImpl");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$1");
+ "runtime.PageContextImpl$1");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$2");
+ "runtime.PageContextImpl$2");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$3");
+ "runtime.PageContextImpl$3");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$4");
+ "runtime.PageContextImpl$4");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$5");
+ "runtime.PageContextImpl$5");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$6");
+ "runtime.PageContextImpl$6");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$7");
+ "runtime.PageContextImpl$7");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$8");
+ "runtime.PageContextImpl$8");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$9");
+ "runtime.PageContextImpl$9");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$10");
+ "runtime.PageContextImpl$10");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$11");
+ "runtime.PageContextImpl$11");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$12");
+ "runtime.PageContextImpl$12");
loader.loadClass( basePackage +
- "runtime.PageContextImpl$13");
+ "runtime.PageContextImpl$13");
loader.loadClass( basePackage +
- "runtime.JspContextWrapper");
+ "runtime.JspContextWrapper");
// Trigger loading of class and reading of property
SecurityUtil.isPackageProtectionEnabled();
-
+
loader.loadClass( basePackage +
"servlet.JspServletWrapper");
Modified: tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java (original)
+++ tomcat/trunk/java/org/apache/jasper/security/SecurityUtil.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -25,10 +25,10 @@ import org.apache.jasper.Constants;
*/
public final class SecurityUtil{
-
- private static boolean packageDefinitionEnabled =
+
+ private static boolean packageDefinitionEnabled =
System.getProperty("package.definition") == null ? false : true;
-
+
/**
* Return the <code>SecurityManager</code> only if Security is enabled AND
* package protection mechanism is enabled.
@@ -39,7 +39,7 @@ public final class SecurityUtil{
}
return false;
}
-
+
/**
* Filter the specified message string for characters that are sensitive
Modified: tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JasperLoader.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -27,7 +27,7 @@ import java.security.PermissionCollectio
import org.apache.jasper.Constants;
/**
- * Class loader for loading servlet class files (corresponding to JSP files)
+ * Class loader for loading servlet class files (corresponding to JSP files)
* and tag handler class files (corresponding to tag files).
*
* @author Anil K. Vijendran
@@ -73,40 +73,40 @@ public class JasperLoader extends URLCla
* <code>Class</code> object is returned.</li>
* <li>If the <code>delegate</code> property is set to <code>true</code>,
* call the <code>loadClass()</code> method of the parent class
- * loader, if any.</li>
+ * loader, if any.</li>
* <li>Call <code>findClass()</code> to find this class in our locally
- * defined repositories.</li>
+ * defined repositories.</li>
* <li>Call the <code>loadClass()</code> method of our parent
- * class loader, if any.</li>
+ * class loader, if any.</li>
* </ul>
* If the class was found using the above steps, and the
* <code>resolve</code> flag is <code>true</code>, this method will then
* call <code>resolveClass(Class)</code> on the resulting Class object.
- *
+ *
* @param name Name of the class to be loaded
* @param resolve If <code>true</code> then resolve the class
- *
+ *
* @exception ClassNotFoundException if the class was not found
- */
+ */
@Override
public synchronized Class<?> loadClass(final String name, boolean resolve)
throws ClassNotFoundException {
- Class<?> clazz = null;
-
+ Class<?> clazz = null;
+
// (0) Check our previously loaded class cache
- clazz = findLoadedClass(name);
- if (clazz != null) {
- if (resolve)
- resolveClass(clazz);
- return (clazz);
- }
-
+ clazz = findLoadedClass(name);
+ if (clazz != null) {
+ if (resolve)
+ resolveClass(clazz);
+ return (clazz);
+ }
+
// (.5) Permission to access this class when using a SecurityManager
- if (securityManager != null) {
+ if (securityManager != null) {
int dot = name.lastIndexOf('.');
- if (dot >= 0) {
- try {
+ if (dot >= 0) {
+ try {
// Do not call the security manager since by default, we grant that package.
if (!"org.apache.jasper.runtime".equalsIgnoreCase(name.substring(0,dot))){
securityManager.checkPackageAccess(name.substring(0,dot));
@@ -116,14 +116,14 @@ public class JasperLoader extends URLCla
"Restricted Class: " + name;
se.printStackTrace();
throw new ClassNotFoundException(error);
- }
- }
+ }
+ }
}
if( !name.startsWith(Constants.JSP_PACKAGE_NAME + '.') ) {
// Class is not in org.apache.jsp, therefore, have our
// parent load it
- clazz = parent.loadClass(name);
+ clazz = parent.loadClass(name);
if( resolve )
resolveClass(clazz);
return clazz;
@@ -132,10 +132,10 @@ public class JasperLoader extends URLCla
return findClass(name);
}
-
+
/**
* Delegate to parent
- *
+ *
* @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
*/
@Override
@@ -153,8 +153,8 @@ public class JasperLoader extends URLCla
}
return is;
}
-
-
+
+
/**
* Get the Permissions for a CodeSource.
*
Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -242,8 +242,8 @@ public class JspCServletContext implemen
}
}
-
-
+
+
/**
* Return a request dispatcher for the specified context-relative path.
*
Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -81,14 +81,14 @@ public class JspServlet extends HttpServ
*/
@Override
public void init(ServletConfig config) throws ServletException {
-
+
super.init(config);
this.config = config;
this.context = config.getServletContext();
-
+
// Initialize the JSP Runtime Context
// Check for a custom Options implementation
- String engineOptionsName =
+ String engineOptionsName =
config.getInitParameter("engineOptionsClass");
if (engineOptionsName != null) {
// Instantiate the indicated Options implementation
@@ -273,10 +273,10 @@ public class JspServlet extends HttpServ
}
}
-
+
@Override
- public void service (HttpServletRequest request,
+ public void service (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
//jspFile may be configured as an init-param for this servlet instance
@@ -307,7 +307,7 @@ public class JspServlet extends HttpServ
}
} else {
/*
- * Requested JSP has not been the target of a
+ * Requested JSP has not been the target of a
* RequestDispatcher.include(). Reconstruct its path from the
* request's getServletPath() and getPathInfo()
*/
@@ -319,7 +319,7 @@ public class JspServlet extends HttpServ
}
}
- if (log.isDebugEnabled()) {
+ if (log.isDebugEnabled()) {
log.debug("JspEngine --> " + jspUri);
log.debug("\t ServletPath: " + request.getServletPath());
log.debug("\t PathInfo: " + request.getPathInfo());
Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -75,7 +75,7 @@ public class JspServletWrapper {
new HashMap<String,Long>();
static {
- // If this is missing,
+ // If this is missing,
ALWAYS_OUTDATED_DEPENDENCIES.put("/WEB-INF/web.xml", Long.valueOf(-1));
}
@@ -155,7 +155,7 @@ public class JspServletWrapper {
public Servlet getServlet() throws ServletException {
// DCL on 'reload' requires that 'reload' be volatile
- // (this also forces a read memory barrier, ensuring the
+ // (this also forces a read memory barrier, ensuring the
// new servlet object is read consistently)
if (reload) {
synchronized (this) {
@@ -164,7 +164,7 @@ public class JspServletWrapper {
if (reload) {
// This is to maintain the original protocol.
destroy();
-
+
final Servlet servlet;
try {
@@ -177,7 +177,7 @@ public class JspServletWrapper {
} catch (Exception e) {
throw new JasperException(e);
}
-
+
servlet.init(config);
if (!firstTime) {
@@ -188,7 +188,7 @@ public class JspServletWrapper {
reload = false;
// Volatile 'reload' forces in order write of 'theServlet' and new servlet object
}
- }
+ }
}
return theServlet;
}
@@ -321,11 +321,11 @@ public class JspServletWrapper {
return unloadHandle;
}
- public void service(HttpServletRequest request,
+ public void service(HttpServletRequest request,
HttpServletResponse response,
boolean precompile)
throws ServletException, IOException, FileNotFoundException {
-
+
Servlet servlet;
try {
@@ -400,7 +400,7 @@ public class JspServletWrapper {
}
try {
-
+
/*
* (3) Handle limitation of number of loaded Jsps
*/
@@ -449,7 +449,7 @@ public class JspServletWrapper {
available = System.currentTimeMillis() +
(unavailableSeconds * 1000L);
response.sendError
- (HttpServletResponse.SC_SERVICE_UNAVAILABLE,
+ (HttpServletResponse.SC_SERVICE_UNAVAILABLE,
ex.getMessage());
} catch (ServletException ex) {
if(options.getDevelopment()) {
@@ -539,7 +539,7 @@ public class JspServletWrapper {
}
}
-
+
if (jspFrame == null ||
this.ctxt.getCompiler().getPageNodes() == null) {
// If we couldn't find a frame in the stack trace corresponding
@@ -568,9 +568,9 @@ public class JspServletWrapper {
("jsp.exception", detail.getJspFileName(),
"" + jspLineNumber) + Constants.NEWLINE +
Constants.NEWLINE + detail.getJspExtract() +
- Constants.NEWLINE + Constants.NEWLINE +
+ Constants.NEWLINE + Constants.NEWLINE +
"Stacktrace:", ex);
-
+
}
return new JasperException(Localizer.getMessage
Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/Util.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -41,17 +41,17 @@ import org.apache.jasper.Constants;
*/
public class Util {
-
- public static final String VALID_SCHEME_CHAR =
+
+ public static final String VALID_SCHEME_CHAR =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+.-";
-
- public static final String DEFAULT_ENCODING =
+
+ public static final String DEFAULT_ENCODING =
"ISO-8859-1";
-
+
public static final int HIGHEST_SPECIAL = '>';
-
+
private static char[][] specialCharactersRepresentation = new char[HIGHEST_SPECIAL + 1][];
-
+
static {
specialCharactersRepresentation['&'] = "&".toCharArray();
specialCharactersRepresentation['<'] = "<".toCharArray();
@@ -59,7 +59,7 @@ public class Util {
specialCharactersRepresentation['"'] = """.toCharArray();
specialCharactersRepresentation['\''] = "'".toCharArray();
}
-
+
/**
* Converts the given string description of a scope to the corresponding
* PageContext constant.
@@ -70,12 +70,12 @@ public class Util {
* @param scope String description of scope
*
* @return PageContext constant corresponding to given scope description
- *
- * taken from org.apache.taglibs.standard.tag.common.core.Util
+ *
+ * taken from org.apache.taglibs.standard.tag.common.core.Util
*/
public static int getScope(String scope){
int ret = PageContext.PAGE_SCOPE;
-
+
if("request".equalsIgnoreCase(scope)){
ret = PageContext.REQUEST_SCOPE;
}else if("session".equalsIgnoreCase(scope)){
@@ -83,10 +83,10 @@ public class Util {
}else if("application".equalsIgnoreCase(scope)){
ret = PageContext.APPLICATION_SCOPE;
}
-
+
return ret;
}
-
+
/**
* Returns <tt>true</tt> if our current URL is absolute,
* <tt>false</tt> otherwise.
@@ -96,21 +96,21 @@ public class Util {
if(url == null){
return false;
}
-
+
int colonPos = url.indexOf(":");
if(colonPos == -1){
return false;
}
-
+
for(int i=0;i<colonPos;i++){
if(VALID_SCHEME_CHAR.indexOf(url.charAt(i)) == -1){
return false;
}
}
-
+
return true;
}
-
+
/**
* Get the value associated with a content-type attribute.
* Syntax defined in RFC 2045, section 5.1.
@@ -126,7 +126,7 @@ public class Util {
if (index == -1) return null;
index += 1; // positioned after the '='
input = input.substring(index).trim();
-
+
if (input.charAt(0) == '"') {
// attribute value is a quoted string
begin = 1;
@@ -140,13 +140,13 @@ public class Util {
}
return input.substring(begin, end).trim();
}
-
+
/**
* Strips a servlet session ID from <tt>url</tt>. The session ID
* is encoded as a URL "path parameter" beginning with "jsessionid=".
* We thus remove anything we find between ";jsessionid=" (inclusive)
* and either EOS or a subsequent ';' (exclusive).
- *
+ *
* taken from org.apache.taglibs.standard.tag.common.core.ImportSupport
*/
public static String stripSession(String url) {
@@ -162,8 +162,8 @@ public class Util {
}
return u.toString();
}
-
-
+
+
/**
* Performs the following substring replacements
* (to facilitate output to XML/HTML pages):
@@ -175,7 +175,7 @@ public class Util {
* ' -> '
*
* See also OutSupport.writeEscapedXml().
- *
+ *
* taken from org.apache.taglibs.standard.tag.common.core.Util
*/
@SuppressWarnings("null") // escapedBuffer cannot be null
@@ -184,7 +184,7 @@ public class Util {
int length = buffer.length();
char[] arrayBuffer = buffer.toCharArray();
StringBuilder escapedBuffer = null;
-
+
for (int i = 0; i < length; i++) {
char c = arrayBuffer[i];
if (c <= HIGHEST_SPECIAL) {
@@ -214,7 +214,7 @@ public class Util {
}
return escapedBuffer.toString();
}
-
+
/** Utility methods
* taken from org.apache.taglibs.standard.tag.common.core.UrlSupport
*/
@@ -224,7 +224,7 @@ public class Util {
// don't touch absolute URLs
if (isAbsoluteUrl(url))
return url;
-
+
// normalize relative URLs against a context root
HttpServletRequest request =
(HttpServletRequest) pageContext.getRequest();
@@ -248,12 +248,12 @@ public class Util {
}
}
}
-
- /** Wraps responses to allow us to retrieve results as Strings.
- * mainly taken from org.apache.taglibs.standard.tag.common.core.importSupport
+
+ /** Wraps responses to allow us to retrieve results as Strings.
+ * mainly taken from org.apache.taglibs.standard.tag.common.core.importSupport
*/
public static class ImportResponseWrapper extends HttpServletResponseWrapper{
-
+
private StringWriter sw = new StringWriter();
private ByteArrayOutputStream bos = new ByteArrayOutputStream();
private ServletOutputStream sos = new ServletOutputStream() {
@@ -266,12 +266,12 @@ public class Util {
private boolean isStreamUsed;
private int status = 200;
private String charEncoding;
-
+
public ImportResponseWrapper(HttpServletResponse arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
-
+
@Override
public PrintWriter getWriter() {
if (isStreamUsed)
@@ -280,7 +280,7 @@ public class Util {
isWriterUsed = true;
return new PrintWriter(sw);
}
-
+
@Override
public ServletOutputStream getOutputStream() {
if (isWriterUsed)
@@ -289,37 +289,37 @@ public class Util {
isStreamUsed = true;
return sos;
}
-
+
/** Has no effect. */
@Override
public void setContentType(String x) {
// ignore
}
-
+
/** Has no effect. */
@Override
public void setLocale(Locale x) {
// ignore
}
-
+
@Override
public void setStatus(int status) {
this.status = status;
}
-
+
@Override
public int getStatus() {
return status;
}
-
+
public String getCharEncoding(){
return this.charEncoding;
}
-
+
public void setCharEncoding(String ce){
this.charEncoding = ce;
}
-
+
public String getString() throws UnsupportedEncodingException {
if (isWriterUsed)
return sw.toString();
@@ -332,5 +332,5 @@ public class Util {
return ""; // target didn't write anything
}
}
-
+
}
Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Catch.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Catch.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Catch.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Catch.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -22,43 +22,43 @@ import org.apache.jasper.compiler.tagplu
import org.apache.jasper.compiler.tagplugin.TagPluginContext;
public class Catch implements TagPlugin {
-
+
@Override
public void doTag(TagPluginContext ctxt) {
-
+
//flag for the existence of the var attribute
boolean hasVar = ctxt.isAttributeSpecified("var");
-
+
//temp name for exception and caught
String exceptionName = ctxt.getTemporaryVariableName();
String caughtName = ctxt.getTemporaryVariableName();
-
+
//main part to generate code
ctxt.generateJavaSource("boolean " + caughtName + " = false;");
ctxt.generateJavaSource("try{");
ctxt.generateBody();
ctxt.generateJavaSource("}");
-
+
//do catch
ctxt.generateJavaSource("catch(Throwable " + exceptionName + "){");
-
- //if the var specified, the exception object should
- //be set to the attribute "var" defines in page scope
+
+ //if the var specified, the exception object should
+ //be set to the attribute "var" defines in page scope
if(hasVar){
String strVar = ctxt.getConstantAttribute("var");
- ctxt.generateJavaSource(" pageContext.setAttribute(\"" + strVar + "\", "
+ ctxt.generateJavaSource(" pageContext.setAttribute(\"" + strVar + "\", "
+ exceptionName + ", PageContext.PAGE_SCOPE);");
}
-
- //whenever there's exception caught,
+
+ //whenever there's exception caught,
//the flag caught should be set true;
ctxt.generateJavaSource(" " + caughtName + " = true;");
ctxt.generateJavaSource("}");
-
+
//do finally
ctxt.generateJavaSource("finally{");
-
- //if var specified, the attribute it defines
+
+ //if var specified, the attribute it defines
//in page scope should be removed
if(hasVar){
String strVar = ctxt.getConstantAttribute("var");
@@ -66,8 +66,8 @@ public class Catch implements TagPlugin
ctxt.generateJavaSource(" pageContext.removeAttribute(\"" + strVar + "\", PageContext.PAGE_SCOPE);");
ctxt.generateJavaSource(" }");
}
-
+
ctxt.generateJavaSource("}");
}
-
+
}
Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Choose.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Choose.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Choose.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/Choose.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -22,13 +22,13 @@ import org.apache.jasper.compiler.tagplu
import org.apache.jasper.compiler.tagplugin.TagPluginContext;
public final class Choose implements TagPlugin {
-
+
@Override
public void doTag(TagPluginContext ctxt) {
-
+
// Not much to do here, much of the work will be done in the
// containing tags, <c:when> and <c:otherwise>.
-
+
ctxt.generateBody();
// See comments in When.java for the reason "}" is generated here.
ctxt.generateJavaSource("}");
Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForEach.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -22,31 +22,31 @@ import org.apache.jasper.compiler.tagplu
import org.apache.jasper.compiler.tagplugin.TagPluginContext;
public final class ForEach implements TagPlugin {
-
+
private boolean hasVar, hasBegin, hasEnd, hasStep;
-
+
@Override
public void doTag(TagPluginContext ctxt) {
-
+
String index = null;
-
+
boolean hasVarStatus = ctxt.isAttributeSpecified("varStatus");
if (hasVarStatus) {
ctxt.dontUseTagPlugin();
return;
}
-
+
hasVar = ctxt.isAttributeSpecified("var");
hasBegin = ctxt.isAttributeSpecified("begin");
hasEnd = ctxt.isAttributeSpecified("end");
hasStep = ctxt.isAttributeSpecified("step");
-
+
boolean hasItems = ctxt.isAttributeSpecified("items");
if (hasItems) {
doCollection(ctxt);
return;
}
-
+
// We must have a begin and end attributes
index = ctxt.getTemporaryVariableName();
ctxt.generateJavaSource("for (int " + index + " = ");
@@ -61,7 +61,7 @@ public final class ForEach implements Ta
else {
ctxt.generateJavaSource("; " + index + "++) {");
}
-
+
// If var is specified and the body contains an EL, then sycn
// the var attribute
if (hasVar /* && ctxt.hasEL() */) {
@@ -72,21 +72,21 @@ public final class ForEach implements Ta
ctxt.generateBody();
ctxt.generateJavaSource("}");
}
-
+
/**
* Generate codes for Collections
* The pseudo code is:
*/
private void doCollection(TagPluginContext ctxt) {
-
+
ctxt.generateImport("java.util.*");
generateIterators(ctxt);
-
+
String itemsV = ctxt.getTemporaryVariableName();
ctxt.generateJavaSource("Object " + itemsV + "= ");
ctxt.generateAttribute("items");
ctxt.generateJavaSource(";");
-
+
String indexV=null, beginV=null, endV=null, stepV=null;
if (hasBegin) {
beginV = ctxt.getTemporaryVariableName();
@@ -108,7 +108,7 @@ public final class ForEach implements Ta
ctxt.generateAttribute("step");
ctxt.generateJavaSource(";");
}
-
+
String iterV = ctxt.getTemporaryVariableName();
ctxt.generateJavaSource("Iterator " + iterV + " = null;");
// Object[]
@@ -138,23 +138,23 @@ public final class ForEach implements Ta
// double[]
ctxt.generateJavaSource("else if (" + itemsV + " instanceof double[])");
ctxt.generateJavaSource(iterV + "=toIterator((double[])" + itemsV + ");");
-
+
// Collection
ctxt.generateJavaSource("else if (" + itemsV + " instanceof Collection)");
ctxt.generateJavaSource(iterV + "=((Collection)" + itemsV + ").iterator();");
-
+
// Iterator
ctxt.generateJavaSource("else if (" + itemsV + " instanceof Iterator)");
ctxt.generateJavaSource(iterV + "=(Iterator)" + itemsV + ";");
-
+
// Enumeration
ctxt.generateJavaSource("else if (" + itemsV + " instanceof Enumeration)");
ctxt.generateJavaSource(iterV + "=toIterator((Enumeration)" + itemsV + ");");
-
+
// Map
ctxt.generateJavaSource("else if (" + itemsV + " instanceof Map)");
ctxt.generateJavaSource(iterV + "=((Map)" + itemsV + ").entrySet().iterator();");
-
+
if (hasBegin) {
String tV = ctxt.getTemporaryVariableName();
ctxt.generateJavaSource("for (int " + tV + "=" + beginV + ";" +
@@ -162,16 +162,16 @@ public final class ForEach implements Ta
tV + "--)");
ctxt.generateJavaSource(iterV + ".next();");
}
-
+
ctxt.generateJavaSource("while (" + iterV + ".hasNext()){");
if (hasVar) {
ctxt.generateJavaSource("_jspx_page_context.setAttribute(");
ctxt.generateAttribute("var");
ctxt.generateJavaSource(", " + iterV + ".next());");
}
-
+
ctxt.generateBody();
-
+
if (hasStep) {
String tV = ctxt.getTemporaryVariableName();
ctxt.generateJavaSource("for (int " + tV + "=" + stepV + "-1;" +
@@ -197,14 +197,14 @@ public final class ForEach implements Ta
}
ctxt.generateJavaSource("}"); // while
}
-
+
/**
* Generate iterators for data types supported in items
*/
private void generateIterators(TagPluginContext ctxt) {
-
+
// Object[]
- ctxt.generateDeclaration("ObjectArrayIterator",
+ ctxt.generateDeclaration("ObjectArrayIterator",
"private Iterator toIterator(final Object[] a){\n" +
" return (new Iterator() {\n" +
" int index=0;\n" +
@@ -216,9 +216,9 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// boolean[]
- ctxt.generateDeclaration("booleanArrayIterator",
+ ctxt.generateDeclaration("booleanArrayIterator",
"private Iterator toIterator(final boolean[] a){\n" +
" return (new Iterator() {\n" +
" int index=0;\n" +
@@ -230,9 +230,9 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// byte[]
- ctxt.generateDeclaration("byteArrayIterator",
+ ctxt.generateDeclaration("byteArrayIterator",
"private Iterator toIterator(final byte[] a){\n" +
" return (new Iterator() {\n" +
" int index=0;\n" +
@@ -244,9 +244,9 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// char[]
- ctxt.generateDeclaration("charArrayIterator",
+ ctxt.generateDeclaration("charArrayIterator",
"private Iterator toIterator(final char[] a){\n" +
" return (new Iterator() {\n" +
" int index=0;\n" +
@@ -258,9 +258,9 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// short[]
- ctxt.generateDeclaration("shortArrayIterator",
+ ctxt.generateDeclaration("shortArrayIterator",
"private Iterator toIterator(final short[] a){\n" +
" return (new Iterator() {\n" +
" int index=0;\n" +
@@ -272,9 +272,9 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// int[]
- ctxt.generateDeclaration("intArrayIterator",
+ ctxt.generateDeclaration("intArrayIterator",
"private Iterator toIterator(final int[] a){\n" +
" return (new Iterator() {\n" +
" int index=0;\n" +
@@ -286,9 +286,9 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// long[]
- ctxt.generateDeclaration("longArrayIterator",
+ ctxt.generateDeclaration("longArrayIterator",
"private Iterator toIterator(final long[] a){\n" +
" return (new Iterator() {\n" +
" int index=0;\n" +
@@ -300,7 +300,7 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// float[]
ctxt.generateDeclaration("floatArrayIterator",
"private Iterator toIterator(final float[] a){\n" +
@@ -314,7 +314,7 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// double[]
ctxt.generateDeclaration("doubleArrayIterator",
"private Iterator toIterator(final double[] a){\n" +
@@ -328,7 +328,7 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
// Enumeration
ctxt.generateDeclaration("enumIterator",
"private Iterator toIterator(final Enumeration e){\n" +
@@ -341,6 +341,6 @@ public final class ForEach implements Ta
" });\n" +
"}"
);
-
+
}
}
Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/ForTokens.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -22,23 +22,23 @@ import org.apache.jasper.compiler.tagplu
import org.apache.jasper.compiler.tagplugin.TagPluginContext;
public class ForTokens implements TagPlugin {
-
+
@Override
public void doTag(TagPluginContext ctxt) {
boolean hasVar, hasVarStatus, hasBegin, hasEnd, hasStep;
-
+
//init the flags
hasVar = ctxt.isAttributeSpecified("var");
hasVarStatus = ctxt.isAttributeSpecified("varStatus");
hasBegin = ctxt.isAttributeSpecified("begin");
hasEnd = ctxt.isAttributeSpecified("end");
hasStep = ctxt.isAttributeSpecified("step");
-
+
if(hasVarStatus){
ctxt.dontUseTagPlugin();
return;
}
-
+
//define all the temp variables' names
String itemsName = ctxt.getTemporaryVariableName();
String delimsName = ctxt.getTemporaryVariableName();
@@ -49,21 +49,21 @@ public class ForTokens implements TagPlu
String index = ctxt.getTemporaryVariableName();
String temp = ctxt.getTemporaryVariableName();
String tokensCountName = ctxt.getTemporaryVariableName();
-
- //get the value of the "items" attribute
+
+ //get the value of the "items" attribute
ctxt.generateJavaSource("String " + itemsName + " = (String)");
ctxt.generateAttribute("items");
ctxt.generateJavaSource(";");
-
+
//get the value of the "delim" attribute
ctxt.generateJavaSource("String " + delimsName + " = (String)");
ctxt.generateAttribute("delims");
ctxt.generateJavaSource(";");
-
+
//new a StringTokenizer Object according to the "items" and the "delim"
ctxt.generateJavaSource("java.util.StringTokenizer " + stName + " = " +
"new java.util.StringTokenizer(" + itemsName + ", " + delimsName + ");");
-
+
//if "begin" specified, move the token to the "begin" place
//and record the begin index. default begin place is 0.
ctxt.generateJavaSource("int " + tokensCountName + " = " + stName + ".countTokens();");
@@ -75,10 +75,10 @@ public class ForTokens implements TagPlu
}else{
ctxt.generateJavaSource("int " + beginName + " = 0;");
}
-
+
//when "end" is specified, if the "end" is more than the last index,
//record the end place as the last index, otherwise, record it as "end";
- //default end place is the last index
+ //default end place is the last index
if(hasEnd){
ctxt.generateJavaSource("int " + endName + " = 0;" );
ctxt.generateJavaSource("if((" + tokensCountName + " - 1) < ");
@@ -92,7 +92,7 @@ public class ForTokens implements TagPlu
}else{
ctxt.generateJavaSource("int " + endName + " = " + tokensCountName + " - 1;");
}
-
+
//get the step value from "step" if specified.
//default step value is 1.
if(hasStep){
@@ -102,7 +102,7 @@ public class ForTokens implements TagPlu
}else{
ctxt.generateJavaSource("int " + stepName + " = 1;");
}
-
+
//the loop
ctxt.generateJavaSource("for(int " + index + " = " + beginName + "; " + index + " <= " + endName + "; " + index + "++){");
ctxt.generateJavaSource(" String " + temp + " = " + stName + ".nextToken();");
@@ -116,5 +116,5 @@ public class ForTokens implements TagPlu
ctxt.generateJavaSource(" }");
ctxt.generateJavaSource("}");
}
-
+
}
Modified: tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/If.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/If.java?rev=1187803&r1=1187802&r2=1187803&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/If.java (original)
+++ tomcat/trunk/java/org/apache/jasper/tagplugins/jstl/core/If.java Sat Oct 22 21:18:03 2011
@@ -5,9 +5,9 @@
* 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.
@@ -22,7 +22,7 @@ import org.apache.jasper.compiler.tagplu
import org.apache.jasper.compiler.tagplugin.TagPluginContext;
public final class If implements TagPlugin {
-
+
@Override
public void doTag(TagPluginContext ctxt) {
String condV = ctxt.getTemporaryVariableName();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org