You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Martin Cooper <ma...@apache.org> on 2009/08/14 23:22:17 UTC

Re: svn commit: r804373 [1/19] - in /struts/sandbox/trunk/struts2-jsp-plugin: ./ src/main/java/org/apache/struts2/ src/main/java/org/apache/struts2/jasper/ src/main/java/org/apache/struts2/jasper/compiler/ src/main/java/org/apache/struts2/jasper/comp

A request for the future - *please* don't make mass reformatting
changes in the same commit as other changes. It makes it almost
impossible for anyone to find, let alone review, the material changes,
and also makes any revert a nightmare.

TIA.

--
Martin Cooper


On Fri, Aug 14, 2009 at 2:02 PM, <mu...@apache.org> wrote:
> Author: musachy
> Date: Fri Aug 14 21:02:33 2009
> New Revision: 804373
>
> URL: http://svn.apache.org/viewvc?rev=804373&view=rev
> Log:
> add test to read jsp from jar. reformat code. replace commons logging with xwork logging in jasper.
>
> Modified:
>    struts/sandbox/trunk/struts2-jsp-plugin/pom.xml
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/EmbeddedJSPResult.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPLoader.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPServletConfig.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Constants.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/CustomCompiler.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/EmbeddedServletOptions.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JasperException.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspC.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspCompilationContext.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Options.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/BeanRepository.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Collector.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Compiler.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/DefaultErrorHandler.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Dumper.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ELFunctionMapper.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ELNode.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ELParser.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ErrorDispatcher.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ErrorHandler.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Generator.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ImplicitTagLibraryInfo.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/JasperTagInfo.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/JavacErrorDetail.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/JspConfig.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/JspDocumentParser.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/JspReader.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/JspRuntimeContext.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/JspUtil.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Localizer.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Mark.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Node.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageDataImpl.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/PageInfo.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Parser.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ParserController.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ScriptingVariabler.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/ServletWriter.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/SmapGenerator.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/SmapStratum.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/SmapUtil.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TagFileProcessor.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TagLibraryInfoImpl.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TagPluginManager.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TextOptimizer.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/TldLocationsCache.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/Validator.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/tagplugin/TagPlugin.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/compiler/tagplugin/TagPluginContext.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/BodyContentImpl.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/HttpJspBase.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspContextWrapper.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspFactoryImpl.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspFragmentHelper.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspRuntimeLibrary.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspSourceDependent.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/JspWriterImpl.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PageContextImpl.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/PerThreadTagHandlerPool.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ProtectedFunctionMapper.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/ServletResponseWrapperInclude.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/runtime/TagHandlerPool.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityClassLoad.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/security/SecurityUtil.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JasperLoader.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JspCServletContext.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JspServlet.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/JspServletWrapper.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/servlet/mbeans-descriptors.xml
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/Util.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Catch.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Choose.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/ForEach.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/ForTokens.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/If.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Import.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Otherwise.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Out.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Param.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Redirect.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Remove.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Set.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/Url.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/core/When.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/tagplugins/jstl/tagPlugins.xml
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/util/FastDateFormat.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/util/Queue.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/util/SimplePool.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/util/SystemLogHandler.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/ASCIIReader.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/EncodingMap.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/ParserUtils.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/SymbolTable.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/TreeNode.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/UCSReader.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/UTF8Reader.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLChar.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLEncodingDetector.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLString.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/xmlparser/XMLStringBuffer.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/main/resources/struts-plugin.xml
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/java/org/apache/struts2/EmbeddedJSPResultTest.java
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/resources/org/apache/struts2/beans.jsp
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/resources/org/apache/struts2/broken0.jsp
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/resources/org/apache/struts2/includes0.jsp
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/resources/org/apache/struts2/includes1.jsp
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/resources/org/apache/struts2/includes2.jsp
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/resources/org/apache/struts2/jstl.jsp
>    struts/sandbox/trunk/struts2-jsp-plugin/src/test/resources/org/apache/struts2/tag0.jsp
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/pom.xml
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/pom.xml?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/pom.xml (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/pom.xml Fri Aug 14 21:02:33 2009
> @@ -91,19 +91,22 @@
>             <version>1.1.2</version>
>             <scope>test</scope>
>         </dependency>
> -
> +
>     </dependencies>
>
> -    <!--<build>
> +    <build>
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-surefire-plugin</artifactId>
> +                <version>2.4.2</version>
>                 <configuration>
> +                    <additionalClasspathElements>
> +                        <element>${project.build.testOutputDirectory}/jsps.jar</element>
> +                    </additionalClasspathElements>
>                     <forkMode>never</forkMode>
>                 </configuration>
>             </plugin>
>         </plugins>
> -    </build>-->
> -
> +    </build>
>  </project>
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/EmbeddedJSPResult.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/EmbeddedJSPResult.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/EmbeddedJSPResult.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/EmbeddedJSPResult.java Fri Aug 14 21:02:33 2009
> @@ -1,6 +1,7 @@
>  package org.apache.struts2;
>
>  import com.opensymphony.xwork2.ActionInvocation;
> +import org.apache.commons.lang.xwork.StringUtils;
>  import org.apache.struts2.dispatcher.StrutsResultSupport;
>
>  /**
> @@ -8,6 +9,6 @@
>  */
>  public class EmbeddedJSPResult extends StrutsResultSupport {
>     protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
> -       JSPRuntime.handle(finalLocation);
> +        JSPRuntime.handle(StringUtils.removeStart(finalLocation, "/"));
>     }
>  }
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPLoader.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPLoader.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPLoader.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPLoader.java Fri Aug 14 21:02:33 2009
> @@ -20,16 +20,15 @@
>  */
>  package org.apache.struts2;
>
> +import com.opensymphony.xwork2.util.URLUtil;
> +import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
>  import com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate;
>  import com.opensymphony.xwork2.util.finder.UrlSet;
> -import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
>  import com.opensymphony.xwork2.util.logging.Logger;
>  import com.opensymphony.xwork2.util.logging.LoggerFactory;
> -import com.opensymphony.xwork2.util.URLUtil;
> -import com.opensymphony.xwork2.ActionContext;
>  import org.apache.commons.io.FileUtils;
> -import org.apache.commons.lang.xwork.StringUtils;
>  import org.apache.commons.lang.xwork.ObjectUtils;
> +import org.apache.commons.lang.xwork.StringUtils;
>  import org.apache.struts2.compiler.MemoryClassLoader;
>  import org.apache.struts2.compiler.MemoryJavaFileObject;
>  import org.apache.struts2.jasper.JasperException;
> @@ -37,9 +36,8 @@
>  import org.apache.struts2.jasper.compiler.JspUtil;
>
>  import javax.servlet.Servlet;
> -import javax.servlet.ServletException;
>  import javax.servlet.ServletContext;
> -import javax.servlet.jsp.JspPage;
> +import javax.servlet.ServletException;
>  import javax.tools.*;
>  import java.io.File;
>  import java.io.IOException;
> @@ -219,7 +217,7 @@
>
>     private ClassLoaderInterface getClassLoaderInterface() {
>         ClassLoaderInterface classLoaderInterface = null;
> -        ServletContext ctx =  ServletActionContext.getServletContext();
> +        ServletContext ctx = ServletActionContext.getServletContext();
>         if (ctx != null)
>             classLoaderInterface = (ClassLoaderInterface) ctx.getAttribute(ClassLoaderInterface.CLASS_LOADER_INTERFACE);
>
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPServletConfig.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPServletConfig.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPServletConfig.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/JSPServletConfig.java Fri Aug 14 21:02:33 2009
> @@ -38,7 +38,7 @@
>     }
>
>     public String getInitParameter(String name) {
> -        return null;
> +        return null;
>     }
>
>     public Enumeration getInitParameterNames() {
> @@ -50,6 +50,6 @@
>     }
>
>     public String getServletName() {
> -        return null;
> +        return null;
>     }
>  }
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Constants.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Constants.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Constants.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Constants.java Fri Aug 14 21:02:33 2009
> @@ -28,12 +28,12 @@
>  */
>  public class Constants {
>     /**
> -     * The base class of the generated servlets.
> +     * The base class of the generated servlets.
>      */
>     public static final String JSP_SERVLET_BASE = "org.apache.struts2.jasper.runtime.HttpJspBase";
>
>     /**
> -     * _jspService is the name of the method that is called by
> +     * _jspService is the name of the method that is called by
>      * HttpJspBase.service(). This is where most of the code generated
>      * from JSPs go.
>      */
> @@ -46,19 +46,19 @@
>
>     /**
>      * These classes/packages are automatically imported by the
> -     * generated code.
> +     * generated code.
>      */
> -    public static final String[] STANDARD_IMPORTS = {
> -       "javax.servlet.*",
> -       "javax.servlet.http.*",
> -       "javax.servlet.jsp.*"
> +    public static final String[] STANDARD_IMPORTS = {
> +            "javax.servlet.*",
> +            "javax.servlet.http.*",
> +            "javax.servlet.jsp.*"
>     };
>
>     /**
>      * FIXME
> -     * ServletContext attribute for classpath. This is tomcat specific.
> -     * Other servlet engines may choose to support this attribute if they
> -     * want to have this JSP engine running on them.
> +     * ServletContext attribute for classpath. This is tomcat specific.
> +     * Other servlet engines may choose to support this attribute if they
> +     * want to have this JSP engine running on them.
>      */
>     public static final String SERVLET_CLASSPATH = "org.apache.catalina.jsp_classpath";
>
> @@ -74,9 +74,9 @@
>
>     /**
>      * FIXME
> -     * ServletContext attribute for class loader. This is tomcat specific.
> -     * Other servlet engines can choose to have this attribute if they
> -     * want to have this JSP engine running on them.
> +     * ServletContext attribute for class loader. This is tomcat specific.
> +     * Other servlet engines can choose to have this attribute if they
> +     * want to have this JSP engine running on them.
>      */
>     //public static final String SERVLET_CLASS_LOADER = "org.apache.tomcat.classloader";
>     public static final String SERVLET_CLASS_LOADER = "org.apache.catalina.classloader";
> @@ -85,7 +85,7 @@
>      * Default size of the JSP buffer.
>      */
>     public static final int K = 1024;
> -    public static final int DEFAULT_BUFFER_SIZE = 8*K;
> +    public static final int DEFAULT_BUFFER_SIZE = 8 * K;
>
>     /**
>      * Default size for the tag buffers.
> @@ -99,7 +99,7 @@
>
>     /**
>      * The query parameter that causes the JSP engine to just
> -     * pregenerated the servlet but not invoke it.
> +     * pregenerated the servlet but not invoke it.
>      */
>     public static final String PRECOMPILE = "jsp_precompile";
>
> @@ -115,7 +115,7 @@
>
>     /**
>      * Servlet context and request attributes that the JSP engine
> -     * uses.
> +     * uses.
>      */
>     public static final String INC_REQUEST_URI = "javax.servlet.include.request_uri";
>     public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
> @@ -126,90 +126,92 @@
>     public static final String ALT_DD_ATTR = "org.apache.catalina.deploy.alt_dd";
>
>     /**
> -     * Public Id and the Resource path (of the cached copy)
> -     * of the DTDs for tag library descriptors.
> +     * Public Id and the Resource path (of the cached copy)
> +     * of the DTDs for tag library descriptors.
>      */
> -    public static final String TAGLIB_DTD_PUBLIC_ID_11 =
> -       "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
> -    public static final String TAGLIB_DTD_RESOURCE_PATH_11 =
> -       "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
> -    public static final String TAGLIB_DTD_PUBLIC_ID_12 =
> -       "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
> -    public static final String TAGLIB_DTD_RESOURCE_PATH_12 =
> -       "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
> +    public static final String TAGLIB_DTD_PUBLIC_ID_11 =
> +            "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN";
> +    public static final String TAGLIB_DTD_RESOURCE_PATH_11 =
> +            "/javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd";
> +    public static final String TAGLIB_DTD_PUBLIC_ID_12 =
> +            "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN";
> +    public static final String TAGLIB_DTD_RESOURCE_PATH_12 =
> +            "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
>
>     /**
> -     * Public Id and the Resource path (of the cached copy)
> +     * Public Id and the Resource path (of the cached copy)
>      * of the DTDs for web application deployment descriptors
>      */
> -    public static final String WEBAPP_DTD_PUBLIC_ID_22 =
> -       "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
> -    public static final String WEBAPP_DTD_RESOURCE_PATH_22 =
> -       "/javax/servlet/resources/web-app_2_2.dtd";
> -    public static final String WEBAPP_DTD_PUBLIC_ID_23 =
> -       "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
> -    public static final String WEBAPP_DTD_RESOURCE_PATH_23 =
> -       "/javax/servlet/resources/web-app_2_3.dtd";
> +    public static final String WEBAPP_DTD_PUBLIC_ID_22 =
> +            "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
> +    public static final String WEBAPP_DTD_RESOURCE_PATH_22 =
> +            "/javax/servlet/resources/web-app_2_2.dtd";
> +    public static final String WEBAPP_DTD_PUBLIC_ID_23 =
> +            "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN";
> +    public static final String WEBAPP_DTD_RESOURCE_PATH_23 =
> +            "/javax/servlet/resources/web-app_2_3.dtd";
>
>     /**
>      * List of the Public IDs that we cache, and their
> -     * associated location. This is used by
> +     * associated location. This is used by
>      * an EntityResolver to return the location of the
>      * cached copy of a DTD.
>      */
>     public static final String[] CACHED_DTD_PUBLIC_IDS = {
> -       TAGLIB_DTD_PUBLIC_ID_11,
> -       TAGLIB_DTD_PUBLIC_ID_12,
> -       WEBAPP_DTD_PUBLIC_ID_22,
> -       WEBAPP_DTD_PUBLIC_ID_23,
> +            TAGLIB_DTD_PUBLIC_ID_11,
> +            TAGLIB_DTD_PUBLIC_ID_12,
> +            WEBAPP_DTD_PUBLIC_ID_22,
> +            WEBAPP_DTD_PUBLIC_ID_23,
>     };
>     public static final String[] CACHED_DTD_RESOURCE_PATHS = {
> -       TAGLIB_DTD_RESOURCE_PATH_11,
> -       TAGLIB_DTD_RESOURCE_PATH_12,
> -       WEBAPP_DTD_RESOURCE_PATH_22,
> -       WEBAPP_DTD_RESOURCE_PATH_23,
> +            TAGLIB_DTD_RESOURCE_PATH_11,
> +            TAGLIB_DTD_RESOURCE_PATH_12,
> +            WEBAPP_DTD_RESOURCE_PATH_22,
> +            WEBAPP_DTD_RESOURCE_PATH_23,
>     };
> -
> +
>     /**
>      * Default URLs to download the pluging for Netscape and IE.
>      */
> -    public static final String NS_PLUGIN_URL =
> -        "http://java.sun.com/products/plugin/";
> +    public static final String NS_PLUGIN_URL =
> +            "http://java.sun.com/products/plugin/";
>
> -    public static final String IE_PLUGIN_URL =
> -        "http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0";
> +    public static final String IE_PLUGIN_URL =
> +            "http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0";
>
>     /**
>      * Prefix to use for generated temporary variable names
>      */
>     public static final String TEMP_VARIABLE_NAME_PREFIX =
> -        "_jspx_temp";
> +            "_jspx_temp";
>
>     /**
>      * Previous replacement char for "\$".
> +     *
>      * @deprecated
>      */
> -    public static final char ESC='\u001b';
> -
> +    public static final char ESC = '\u001b';
> +
>     /**
>      * Previous replacement char for "\$".
> +     *
>      * @deprecated
>      */
> -    public static final String ESCStr="'\\u001b'";
> -
> +    public static final String ESCStr = "'\\u001b'";
> +
>     /**
>      * Replacement char for "\$". This is the first unicode character in the
>      * private use area.
>      * XXX This is a hack to avoid changing EL interpreter to recognize "\$"
>      */
>     public static final char HACK_CHAR = '\ue000';
> -
> +
>     /**
>      * Replacement string for "\$". This is the first unicode character in the
>      * private use area.
>      * XXX This is a hack to avoid changing EL interpreter to recognize "\$"
>      */
>     public static final String HACK_STR = "'\\ue000'";
> -
> +
>  }
>
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/CustomCompiler.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/CustomCompiler.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/CustomCompiler.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/CustomCompiler.java Fri Aug 14 21:02:33 2009
> @@ -22,7 +22,7 @@
>
>  import java.io.FileNotFoundException;
>
> -public class CustomCompiler extends org.apache.struts2.jasper.compiler.Compiler{
> +public class CustomCompiler extends org.apache.struts2.jasper.compiler.Compiler {
>
>     public boolean isOutDated() {
>         return true;
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/EmbeddedServletOptions.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/EmbeddedServletOptions.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/EmbeddedServletOptions.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/EmbeddedServletOptions.java Fri Aug 14 21:02:33 2009
> @@ -17,8 +17,8 @@
>
>  package org.apache.struts2.jasper;
>
> -import org.apache.commons.logging.Log;
> -import org.apache.commons.logging.LogFactory;
> +import com.opensymphony.xwork2.util.logging.Logger;
> +import com.opensymphony.xwork2.util.logging.LoggerFactory;
>  import org.apache.struts2.jasper.compiler.JspConfig;
>  import org.apache.struts2.jasper.compiler.Localizer;
>  import org.apache.struts2.jasper.compiler.TagPluginManager;
> @@ -33,254 +33,254 @@
>  import java.util.Properties;
>
>  /**
> - * A class to hold all init parameters specific to the JSP engine.
> + * A class to hold all init parameters specific to the JSP engine.
>  *
>  * @author Anil K. Vijendran
>  * @author Hans Bergsten
>  * @author Pierre Delisle
>  */
>  public final class EmbeddedServletOptions implements Options {
> -
> +
>     // Logger
> -    private Log log = LogFactory.getLog(EmbeddedServletOptions.class);
> -
> +    private Logger log = LoggerFactory.getLogger(EmbeddedServletOptions.class);
> +
>     private Properties settings = new Properties();
> -
> +
>     /**
>      * Is Jasper being used in development mode?
>      */
>     private boolean development = true;
> -
> +
>     /**
>      * Should Ant fork its java compiles of JSP pages.
>      */
>     public boolean fork = true;
> -
> +
>     /**
>      * Do you want to keep the generated Java files around?
>      */
>     private boolean keepGenerated = true;
> -
> +
>     /**
>      * Should white spaces between directives or actions be trimmed?
>      */
>     private boolean trimSpaces = false;
> -
> +
>     /**
>      * Determines whether tag handler pooling is enabled.
>      */
>     private boolean isPoolingEnabled = true;
> -
> +
>     /**
>      * Do you want support for "mapped" files? This will generate
>      * servlet that has a print statement per line of the JSP file.
>      * This seems like a really nice feature to have for debugging.
>      */
>     private boolean mappedFile = true;
> -
> +
>     /**
>      * Do you want stack traces and such displayed in the client's
>      * browser? If this is false, such messages go to the standard
> -     * error or a log file if the standard error is redirected.
> +     * error or a log file if the standard error is redirected.
>      */
>     private boolean sendErrorToClient = false;
> -
> +
>     /**
>      * Do we want to include debugging information in the class file?
>      */
>     private boolean classDebugInfo = true;
> -
> +
>     /**
>      * Background compile thread check interval in seconds.
>      */
>     private int checkInterval = 0;
> -
> +
>     /**
>      * Is the generation of SMAP info for JSR45 debuggin suppressed?
>      */
>     private boolean isSmapSuppressed = false;
> -
> +
>     /**
>      * Should SMAP info for JSR45 debugging be dumped to a file?
>      */
>     private boolean isSmapDumped = false;
> -
> +
>     /**
>      * Are Text strings to be generated as char arrays?
>      */
>     private boolean genStringAsCharArray = false;
> -
> +
>     private boolean errorOnUseBeanInvalidClassAttribute = true;
> -
> +
>     /**
>      * I want to see my generated servlets. Which directory are they
>      * in?
>      */
>     private File scratchDir;
> -
> +
>     /**
>      * Need to have this as is for versions 4 and 5 of IE. Can be set from
>      * the initParams so if it changes in the future all that is needed is
>      * to have a jsp initParam of type ieClassId="<value>"
>      */
>     private String ieClassId = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
> -
> +
>     /**
>      * What classpath should I use while compiling generated servlets?
>      */
>     private String classpath = null;
> -
> +
>     /**
>      * Compiler to use.
>      */
>     private String compiler = null;
> -
> +
>     /**
>      * Compiler target VM.
>      */
>     private String compilerTargetVM = "1.5";
> -
> +
>     /**
>      * The compiler source VM.
>      */
>     private String compilerSourceVM = "1.5";
> -
> +
>     /**
>      * Cache for the TLD locations
>      */
>     private TldLocationsCache tldLocationsCache = null;
> -
> +
>     /**
>      * Jsp config information
>      */
>     private JspConfig jspConfig = null;
> -
> +
>     /**
>      * TagPluginManager
>      */
>     private TagPluginManager tagPluginManager = null;
> -
> +
>     /**
>      * Java platform encoding to generate the JSP
>      * page servlet.
>      */
>     private String javaEncoding = "UTF8";
> -
> +
>     /**
>      * Modification test interval.
>      */
>     private int modificationTestInterval = 4;
> -
> +
>     /**
>      * Is generation of X-Powered-By response header enabled/disabled?
>      */
>     private boolean xpoweredBy;
> -
> -    public String getProperty(String name ) {
> -        return settings.getProperty( name );
> +
> +    public String getProperty(String name) {
> +        return settings.getProperty(name);
>     }
> -
> -    public void setProperty(String name, String value ) {
> -        if (name != null && value != null){
> -            settings.setProperty( name, value );
> +
> +    public void setProperty(String name, String value) {
> +        if (name != null && value != null) {
> +            settings.setProperty(name, value);
>         }
>     }
> -
> +
>     /**
>      * Are we keeping generated code around?
>      */
>     public boolean getKeepGenerated() {
>         return keepGenerated;
>     }
> -
> +
>     /**
>      * Should white spaces between directives or actions be trimmed?
>      */
>     public boolean getTrimSpaces() {
>         return trimSpaces;
>     }
> -
> +
>     public boolean isPoolingEnabled() {
>         return isPoolingEnabled;
>     }
> -
> +
>     /**
>      * Are we supporting HTML mapped servlets?
>      */
>     public boolean getMappedFile() {
>         return mappedFile;
>     }
> -
> +
>     /**
>      * Should errors be sent to client or thrown into stderr?
>      */
>     public boolean getSendErrorToClient() {
>         return sendErrorToClient;
>     }
> -
> +
>     /**
>      * Should class files be compiled with debug information?
>      */
>     public boolean getClassDebugInfo() {
>         return classDebugInfo;
>     }
> -
> +
>     /**
>      * Background JSP compile thread check intervall
>      */
>     public int getCheckInterval() {
>         return checkInterval;
>     }
> -
> +
>     /**
>      * Modification test interval.
>      */
>     public int getModificationTestInterval() {
>         return modificationTestInterval;
>     }
> -
> +
>     /**
>      * Is Jasper being used in development mode?
>      */
>     public boolean getDevelopment() {
>         return development;
>     }
> -
> +
>     /**
>      * Is the generation of SMAP info for JSR45 debuggin suppressed?
>      */
>     public boolean isSmapSuppressed() {
>         return isSmapSuppressed;
>     }
> -
> +
>     /**
>      * Should SMAP info for JSR45 debugging be dumped to a file?
>      */
>     public boolean isSmapDumped() {
>         return isSmapDumped;
>     }
> -
> +
>     /**
>      * Are Text strings to be generated as char arrays?
>      */
>     public boolean genStringAsCharArray() {
>         return this.genStringAsCharArray;
>     }
> -
> +
>     /**
> -     * Class ID for use in the plugin tag when the browser is IE.
> +     * Class ID for use in the plugin tag when the browser is IE.
>      */
>     public String getIeClassId() {
>         return ieClassId;
>     }
> -
> +
>     /**
>      * What is my scratch dir?
>      */
>     public File getScratchDir() {
>         return scratchDir;
>     }
> -
> +
>     /**
>      * What classpath should I use while compiling the servlets
>      * generated from JSP files?
> @@ -288,82 +288,82 @@
>     public String getClassPath() {
>         return classpath;
>     }
> -
> +
>     /**
>      * Is generation of X-Powered-By response header enabled/disabled?
>      */
>     public boolean isXpoweredBy() {
>         return xpoweredBy;
>     }
> -
> +
>     /**
>      * Compiler to use.
>      */
>     public String getCompiler() {
>         return compiler;
>     }
> -
> +
>     /**
>      * @see Options#getCompilerTargetVM
>      */
>     public String getCompilerTargetVM() {
>         return compilerTargetVM;
>     }
> -
> +
>     /**
>      * @see Options#getCompilerSourceVM
>      */
>     public String getCompilerSourceVM() {
>         return compilerSourceVM;
>     }
> -
> +
>     public boolean getErrorOnUseBeanInvalidClassAttribute() {
>         return errorOnUseBeanInvalidClassAttribute;
>     }
> -
> +
>     public void setErrorOnUseBeanInvalidClassAttribute(boolean b) {
>         errorOnUseBeanInvalidClassAttribute = b;
>     }
> -
> +
>     public TldLocationsCache getTldLocationsCache() {
>         return tldLocationsCache;
>     }
> -
> -    public void setTldLocationsCache( TldLocationsCache tldC ) {
> +
> +    public void setTldLocationsCache(TldLocationsCache tldC) {
>         tldLocationsCache = tldC;
>     }
> -
> +
>     public String getJavaEncoding() {
>         return javaEncoding;
>     }
> -
> +
>     public boolean getFork() {
>         return fork;
>     }
> -
> +
>     public JspConfig getJspConfig() {
>         return jspConfig;
>     }
> -
> +
>     public TagPluginManager getTagPluginManager() {
>         return tagPluginManager;
>     }
> -
> +
>     public boolean isCaching() {
>         return false;
>     }
> -
> +
>     public Map getCache() {
>         return null;
>     }
>
>     /**
>      * Create an EmbeddedServletOptions object using data available from
> -     * ServletConfig and ServletContext.
> +     * ServletConfig and ServletContext.
>      */
>     public EmbeddedServletOptions(ServletConfig config,
> -            ServletContext context) {
> -
> +                                  ServletContext context) {
> +
>         // JVM version numbers
>         try {
>             if (Float.parseFloat(System.getProperty("java.specification.version")) > 1.4) {
> @@ -374,18 +374,18 @@
>         } catch (NumberFormatException e) {
>             // Ignore
>         }
> -
> -        Enumeration enumeration=config.getInitParameterNames();
> -        while( enumeration.hasMoreElements() ) {
> -            String k=(String)enumeration.nextElement();
> -            String v=config.getInitParameter( k );
> -            setProperty( k, v);
> +
> +        Enumeration enumeration = config.getInitParameterNames();
> +        while (enumeration.hasMoreElements()) {
> +            String k = (String) enumeration.nextElement();
> +            String v = config.getInitParameter(k);
> +            setProperty(k, v);
>         }
> -
> +
>         // quick hack
> -        String validating=config.getInitParameter( "validating");
> -        if( "false".equals( validating )) ParserUtils.validating=false;
> -
> +        String validating = config.getInitParameter("validating");
> +        if ("false".equals(validating)) ParserUtils.validating = false;
> +
>         String keepgen = config.getInitParameter("keepgenerated");
>         if (keepgen != null) {
>             if (keepgen.equalsIgnoreCase("true")) {
> @@ -398,9 +398,9 @@
>                 }
>             }
>         }
> -
> -
> -        String trimsp = config.getInitParameter("trimSpaces");
> +
> +
> +        String trimsp = config.getInitParameter("trimSpaces");
>         if (trimsp != null) {
>             if (trimsp.equalsIgnoreCase("true")) {
>                 trimSpaces = true;
> @@ -412,10 +412,10 @@
>                 }
>             }
>         }
> -
> +
>         this.isPoolingEnabled = true;
>         String poolingEnabledParam
> -        = config.getInitParameter("enablePooling");
> +                = config.getInitParameter("enablePooling");
>         if (poolingEnabledParam != null
>                 && !poolingEnabledParam.equalsIgnoreCase("true")) {
>             if (poolingEnabledParam.equalsIgnoreCase("false")) {
> @@ -423,11 +423,11 @@
>             } else {
>                 if (log.isWarnEnabled()) {
>                     log.warn(Localizer.getMessage("jsp.warning.enablePooling"));
> -                }
> +                }
>             }
>         }
> -
> -        String mapFile = config.getInitParameter("mappedfile");
> +
> +        String mapFile = config.getInitParameter("mappedfile");
>         if (mapFile != null) {
>             if (mapFile.equalsIgnoreCase("true")) {
>                 this.mappedFile = true;
> @@ -439,7 +439,7 @@
>                 }
>             }
>         }
> -
> +
>         String senderr = config.getInitParameter("sendErrToClient");
>         if (senderr != null) {
>             if (senderr.equalsIgnoreCase("true")) {
> @@ -452,42 +452,42 @@
>                 }
>             }
>         }
> -
> +
>         String debugInfo = config.getInitParameter("classdebuginfo");
>         if (debugInfo != null) {
>             if (debugInfo.equalsIgnoreCase("true")) {
> -                this.classDebugInfo  = true;
> +                this.classDebugInfo = true;
>             } else if (debugInfo.equalsIgnoreCase("false")) {
> -                this.classDebugInfo  = false;
> +                this.classDebugInfo = false;
>             } else {
>                 if (log.isWarnEnabled()) {
>                     log.warn(Localizer.getMessage("jsp.warning.classDebugInfo"));
>                 }
>             }
>         }
> -
> +
>         String checkInterval = config.getInitParameter("checkInterval");
>         if (checkInterval != null) {
>             try {
>                 this.checkInterval = Integer.parseInt(checkInterval);
> -            } catch(NumberFormatException ex) {
> +            } catch (NumberFormatException ex) {
>                 if (log.isWarnEnabled()) {
>                     log.warn(Localizer.getMessage("jsp.warning.checkInterval"));
>                 }
>             }
>         }
> -
> +
>         String modificationTestInterval = config.getInitParameter("modificationTestInterval");
>         if (modificationTestInterval != null) {
>             try {
>                 this.modificationTestInterval = Integer.parseInt(modificationTestInterval);
> -            } catch(NumberFormatException ex) {
> +            } catch (NumberFormatException ex) {
>                 if (log.isWarnEnabled()) {
>                     log.warn(Localizer.getMessage("jsp.warning.modificationTestInterval"));
>                 }
>             }
>         }
> -
> +
>         String development = config.getInitParameter("development");
>         if (development != null) {
>             if (development.equalsIgnoreCase("true")) {
> @@ -500,7 +500,7 @@
>                 }
>             }
>         }
> -
> +
>         String suppressSmap = config.getInitParameter("suppressSmap");
>         if (suppressSmap != null) {
>             if (suppressSmap.equalsIgnoreCase("true")) {
> @@ -513,7 +513,7 @@
>                 }
>             }
>         }
> -
> +
>         String dumpSmap = config.getInitParameter("dumpSmap");
>         if (dumpSmap != null) {
>             if (dumpSmap.equalsIgnoreCase("true")) {
> @@ -526,7 +526,7 @@
>                 }
>             }
>         }
> -
> +
>         String genCharArray = config.getInitParameter("genStrAsCharArray");
>         if (genCharArray != null) {
>             if (genCharArray.equalsIgnoreCase("true")) {
> @@ -539,9 +539,9 @@
>                 }
>             }
>         }
> -
> +
>         String errBeanClass =
> -            config.getInitParameter("errorOnUseBeanInvalidClassAttribute");
> +                config.getInitParameter("errorOnUseBeanInvalidClassAttribute");
>         if (errBeanClass != null) {
>             if (errBeanClass.equalsIgnoreCase("true")) {
>                 errorOnUseBeanInvalidClassAttribute = true;
> @@ -553,19 +553,19 @@
>                 }
>             }
>         }
> -
> +
>         String ieClassId = config.getInitParameter("ieClassId");
>         if (ieClassId != null)
>             this.ieClassId = ieClassId;
> -
> +
>         String classpath = config.getInitParameter("classpath");
>         if (classpath != null)
>             this.classpath = classpath;
> -
> +
>         /*
> -         * scratchdir
> -         */
> -        String dir = config.getInitParameter("scratchdir");
> +        * scratchdir
> +        */
> +        String dir = config.getInitParameter("scratchdir");
>         if (dir != null) {
>             scratchDir = new File(dir);
>         } else {
> @@ -578,34 +578,34 @@
>                 if (dir != null)
>                     scratchDir = new File(dir);
>             }
> -        }
> +        }
>         if (this.scratchDir == null) {
>             log.fatal(Localizer.getMessage("jsp.error.no.scratch.dir"));
>             return;
>         }
> -
> +
>         if (!(scratchDir.exists() && scratchDir.canRead() &&
>                 scratchDir.canWrite() && scratchDir.isDirectory()))
>             log.fatal(Localizer.getMessage("jsp.error.bad.scratch.dir",
>                     scratchDir.getAbsolutePath()));
> -
> +
>         this.compiler = config.getInitParameter("compiler");
> -
> +
>         String compilerTargetVM = config.getInitParameter("compilerTargetVM");
> -        if(compilerTargetVM != null) {
> +        if (compilerTargetVM != null) {
>             this.compilerTargetVM = compilerTargetVM;
>         }
> -
> +
>         String compilerSourceVM = config.getInitParameter("compilerSourceVM");
> -        if(compilerSourceVM != null) {
> +        if (compilerSourceVM != null) {
>             this.compilerSourceVM = compilerSourceVM;
>         }
> -
> +
>         String javaEncoding = config.getInitParameter("javaEncoding");
>         if (javaEncoding != null) {
>             this.javaEncoding = javaEncoding;
>         }
> -
> +
>         String fork = config.getInitParameter("fork");
>         if (fork != null) {
>             if (fork.equalsIgnoreCase("true")) {
> @@ -618,8 +618,8 @@
>                 }
>             }
>         }
> -
> -        String xpoweredBy = config.getInitParameter("xpoweredBy");
> +
> +        String xpoweredBy = config.getInitParameter("xpoweredBy");
>         if (xpoweredBy != null) {
>             if (xpoweredBy.equalsIgnoreCase("true")) {
>                 this.xpoweredBy = true;
> @@ -631,17 +631,17 @@
>                 }
>             }
>         }
> -
> +
>         // Setup the global Tag Libraries location cache for this
>         // web-application.
>         tldLocationsCache = new TldLocationsCache(context);
> -
> +
>         // Setup the jsp config info for this web app.
>         jspConfig = new JspConfig(context);
> -
> +
>         // Create a Tag plugin instance
>         tagPluginManager = new TagPluginManager(context);
>     }
> -
> +
>  }
>
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JasperException.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JasperException.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JasperException.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JasperException.java Fri Aug 14 21:02:33 2009
> @@ -19,28 +19,28 @@
>
>  /**
>  * Base class for all exceptions generated by the JSP engine. Makes it
> - * convienient to catch just this at the top-level.
> + * convienient to catch just this at the top-level.
>  *
>  * @author Anil K. Vijendran
>  */
>  public class JasperException extends javax.servlet.ServletException {
> -
> +
>     public JasperException(String reason) {
> -       super(reason);
> +        super(reason);
>     }
>
>     /**
>      * Creates a JasperException with the embedded exception and the reason for
>      * throwing a JasperException
>      */
> -    public JasperException (String reason, Throwable exception) {
> -       super(reason, exception);
> +    public JasperException(String reason, Throwable exception) {
> +        super(reason, exception);
>     }
>
>     /**
>      * Creates a JasperException with the embedded exception
>      */
> -    public JasperException (Throwable exception) {
> -       super(exception);
> +    public JasperException(Throwable exception) {
> +        super(exception);
>     }
>  }
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspC.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspC.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspC.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspC.java Fri Aug 14 21:02:33 2009
> @@ -18,7 +18,8 @@
>  package org.apache.struts2.jasper;
>
>  import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
> -import org.apache.commons.logging.Log;
> +import com.opensymphony.xwork2.util.logging.Logger;
> +import com.opensymphony.xwork2.util.logging.LoggerFactory;
>  import org.apache.commons.logging.LogFactory;
>  import org.apache.struts2.jasper.compiler.Compiler;
>  import org.apache.struts2.jasper.compiler.*;
> @@ -33,10 +34,10 @@
>  * Shell for the jspc compiler.  Handles all options associated with the
>  * command line and creates compilation contexts which it then compiles
>  * according to the specified options.
> - *
> + * <p/>
>  * This version can process files from a _single_ webapp at once, i.e.
>  * a single docbase can be specified.
> - *
> + * <p/>
>  * It can be used as an Ant task using:
>  * <pre>
>  *   &lt;taskdef classname="org.apache.struts.jasperJspC" name="jasper2" &gt;
> @@ -51,7 +52,7 @@
>  *          &lt;path refid="myjars"/&gt;
>  *       &lt;/classpath&gt;
>  *  &lt;/taskdef&gt;
> - *
> + * <p/>
>  *  &lt;jasper2 verbose="0"
>  *           package="my.package"
>  *           uriroot="${webapps.dir}/${webapp.name}"
> @@ -65,12 +66,16 @@
>  * @author Yoav Shapira
>  */
>  public class JspC implements Options {
> -    /** The default Microsoft Internet Explorer class ID. */
> +    /**
> +     * The default Microsoft Internet Explorer class ID.
> +     */
>     public static final String DEFAULT_IE_CLASS_ID =
>             "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
>
> -    /** Logger (set by constructor.) */
> -    private Log log;
> +    /**
> +     * Logger (set by constructor.)
> +     */
> +    private Logger log;
>
>     private static final String SWITCH_VERBOSE = "-v";
>     private static final String SWITCH_HELP = "-help";
> @@ -99,7 +104,7 @@
>     private static final String SWITCH_SMAP = "-smap";
>     private static final String SWITCH_DUMP_SMAP = "-dumpsmap";
>
> -    private static final String SHOW_SUCCESS ="-s";
> +    private static final String SHOW_SUCCESS = "-s";
>     private static final String LIST_ERRORS = "-l";
>     private static final int NO_WEBXML = 0;
>     private static final int INC_WEBXML = 10;
> @@ -108,11 +113,11 @@
>     private static final int NO_DIE_LEVEL = 0;
>
>     private static final String[] insertBefore =
> -    { "</web-app>", "<servlet-mapping>", "<session-config>",
> -      "<mime-mapping>", "<welcome-file-list>", "<error-page>", "<taglib>",
> -      "<resource-env-ref>", "<resource-ref>", "<security-constraint>",
> -      "<login-config>", "<security-role>", "<env-entry>", "<ejb-ref>",
> -      "<ejb-local-ref>" };
> +            {"</web-app>", "<servlet-mapping>", "<session-config>",
> +                    "<mime-mapping>", "<welcome-file-list>", "<error-page>", "<taglib>",
> +                    "<resource-env-ref>", "<resource-ref>", "<security-constraint>",
> +                    "<login-config>", "<security-role>", "<env-entry>", "<ejb-ref>",
> +                    "<ejb-local-ref>"};
>
>     private static int die;
>     private String classPath = null;
> @@ -231,9 +236,11 @@
>         }
>     }
>
> -    /** Constructor. */
> +    /**
> +     * Constructor.
> +     */
>     public JspC() {
> -        log = LogFactory.getLog(getClass());
> +        log = LoggerFactory.getLogger(getClass());
>     }
>
>     public String getSourceCode() {
> @@ -258,18 +265,18 @@
>                 listErrors = true;
>             } else if (tok.equals(SWITCH_OUTPUT_DIR)) {
>                 tok = nextArg();
> -                setOutputDir( tok );
> +                setOutputDir(tok);
>             } else if (tok.equals(SWITCH_PACKAGE_NAME)) {
>                 targetPackage = nextArg();
>             } else if (tok.equals(SWITCH_COMPILE)) {
> -                compile=true;
> +                compile = true;
>             } else if (tok.equals(SWITCH_CLASS_NAME)) {
>                 targetClassName = nextArg();
>             } else if (tok.equals(SWITCH_URI_BASE)) {
> -                uriBase=nextArg();
> -            } else if ( tok.equals( SHOW_SUCCESS ) ) {
> +                uriBase = nextArg();
> +            } else if (tok.equals(SHOW_SUCCESS)) {
>                 showSuccess = true;
> -            } else if ( tok.equals( LIST_ERRORS ) ) {
> +            } else if (tok.equals(LIST_ERRORS)) {
>                 listErrors = true;
>             } else if (tok.equals(SWITCH_WEBAPP_INC)) {
>                 webxmlFile = nextArg();
> @@ -293,13 +300,13 @@
>                     caching = false;
>                 } else {
>                     caching = true;
> -                }
> +                }
>             } else if (tok.equals(SWITCH_CLASSPATH)) {
>                 setClassPath(nextArg());
>             } else if (tok.startsWith(SWITCH_DIE)) {
>                 try {
>                     dieLevel = Integer.parseInt(
> -                        tok.substring(SWITCH_DIE.length()));
> +                            tok.substring(SWITCH_DIE.length()));
>                 } catch (NumberFormatException nfe) {
>                     dieLevel = DEFAULT_DIE_LEVEL;
>                 }
> @@ -326,7 +333,7 @@
>             } else {
>                 if (tok.startsWith("-")) {
>                     throw new JasperException("Unrecognized option: " + tok +
> -                        ".  Use -help for help.");
> +                            ".  Use -help for help.");
>                 }
>                 if (!fullstop) {
>                     argPos--;
> @@ -337,12 +344,12 @@
>         }
>
>         // Add all extra arguments to the list of files
> -        while( true ) {
> +        while (true) {
>             String file = nextFile();
> -            if( file==null ) {
> +            if (file == null) {
>                 break;
>             }
> -            pages.add( file );
> +            pages.add(file);
>         }
>     }
>
> @@ -404,8 +411,8 @@
>         return true;
>     }
>
> -    public void setClassDebugInfo( boolean b ) {
> -        classDebugInfo=b;
> +    public void setClassDebugInfo(boolean b) {
> +        classDebugInfo = b;
>     }
>
>     public boolean getClassDebugInfo() {
> @@ -413,8 +420,8 @@
>         return classDebugInfo;
>     }
>
> -     /**
> -      * @see Options#isCaching()
> +    /**
> +     * @see Options#isCaching()
>      */
>     public boolean isCaching() {
>         return caching;
> @@ -469,7 +476,7 @@
>         this.smapSuppressed = smapSuppressed;
>     }
>
> -
> +
>     /**
>      * Should SMAP info for JSR45 debugging be dumped to a file?
>      */
> @@ -484,13 +491,13 @@
>         this.smapDumped = smapDumped;
>     }
>
> -
> +
>     /**
>      * Determines whether text strings are to be generated as char arrays,
>      * which improves performance in some cases.
>      *
>      * @param genStringAsCharArray true if text strings are to be generated as
> -     * char arrays, false otherwise
> +     *                             char arrays, false otherwise
>      */
>     public void setGenStringAsCharArray(boolean genStringAsCharArray) {
>         this.genStringAsCharArray = genStringAsCharArray;
> @@ -500,7 +507,7 @@
>      * Indicates whether text strings are to be generated as char arrays.
>      *
>      * @return true if text strings are to be generated as char arrays, false
> -     * otherwise
> +     *         otherwise
>      */
>     public boolean genStringAsCharArray() {
>         return genStringAsCharArray;
> @@ -531,12 +538,12 @@
>     }
>
>     public Class getJspCompilerPlugin() {
> -       // we don't compile, so this is meanlingless
> +        // we don't compile, so this is meanlingless
>         return null;
>     }
>
>     public String getJspCompilerPath() {
> -       // we don't compile, so this is meanlingless
> +        // we don't compile, so this is meanlingless
>         return null;
>     }
>
> @@ -548,7 +555,7 @@
>     }
>
>     public void setCompiler(String c) {
> -        compiler=c;
> +        compiler = c;
>     }
>
>     /**
> @@ -565,10 +572,10 @@
>     /**
>      * @see Options#getCompilerSourceVM()
>      */
> -     public String getCompilerSourceVM() {
> -         return compilerSourceVM;
> -     }
> -
> +    public String getCompilerSourceVM() {
> +        return compilerSourceVM;
> +    }
> +
>     /**
>      * @see Options#getCompilerSourceVM()
>      */
> @@ -605,13 +612,13 @@
>     }
>
>     public String getClassPath() {
> -        if( classPath != null )
> +        if (classPath != null)
>             return classPath;
>         return System.getProperty("java.class.path");
>     }
>
>     public void setClassPath(String s) {
> -        classPath=s;
> +        classPath = s;
>     }
>
>     /**
> @@ -631,8 +638,8 @@
>      * @param extension The extension to add, e.g. "myjsp"
>      */
>     protected void addExtension(final String extension) {
> -        if(extension != null) {
> -            if(extensions == null) {
> +        if (extension != null) {
> +            if (extensions == null) {
>                 extensions = new Vector();
>             }
>
> @@ -643,14 +650,14 @@
>     /**
>      * Parses comma-separated list of JSP files to be processed.  If the argument
>      * is null, nothing is done.
> -     *
> +     * <p/>
>      * <p>Each file is interpreted relative to uriroot, unless it is absolute,
>      * in which case it must start with uriroot.</p>
>      *
>      * @param jspFiles Comma-separated list of JSP files to be processed
>      */
>     public void setJspFiles(final String jspFiles) {
> -        if(jspFiles == null) {
> +        if (jspFiles == null) {
>             return;
>         }
>
> @@ -665,7 +672,7 @@
>      *
>      * @param b Flag value
>      */
> -    public void setCompile( final boolean b ) {
> +    public void setCompile(final boolean b) {
>         compile = b;
>     }
>
> @@ -676,7 +683,7 @@
>      *
>      * @param level Positive means verbose
>      */
> -    public void setVerbose( final int level ) {
> +    public void setVerbose(final int level) {
>         if (level > 0) {
>             verbose = true;
>             showSuccess = true;
> @@ -684,24 +691,24 @@
>         }
>     }
>
> -    public void setValidateXml( boolean b ) {
> -        org.apache.struts2.jasper.xmlparser.ParserUtils.validating=b;
> +    public void setValidateXml(boolean b) {
> +        org.apache.struts2.jasper.xmlparser.ParserUtils.validating = b;
>     }
>
> -    public void setListErrors( boolean b ) {
> +    public void setListErrors(boolean b) {
>         listErrors = b;
>     }
>
> -    public void setOutputDir( String s ) {
> -        if( s!= null ) {
> +    public void setOutputDir(String s) {
> +        if (s != null) {
>             scratchDir = resolveFile(s).getAbsoluteFile();
>         } else {
> -            scratchDir=null;
> +            scratchDir = null;
>         }
>     }
>
> -    public void setPackage( String p ) {
> -        targetPackage=p;
> +    public void setPackage(String p) {
> +        targetPackage = p;
>     }
>
>     /**
> @@ -709,24 +716,24 @@
>      * Can only be used if a single file is converted.
>      * XXX Do we need this feature ?
>      */
> -    public void setClassName( String p ) {
> -        targetClassName=p;
> +    public void setClassName(String p) {
> +        targetClassName = p;
>     }
>
>     /**
>      * File where we generate a web.xml fragment with the class definitions.
>      */
> -    public void setWebXmlFragment( String s ) {
> -        webxmlFile=resolveFile(s).getAbsolutePath();
> -        webxmlLevel=INC_WEBXML;
> +    public void setWebXmlFragment(String s) {
> +        webxmlFile = resolveFile(s).getAbsolutePath();
> +        webxmlLevel = INC_WEBXML;
>     }
>
>     /**
>      * File where we generate a complete web.xml with the class definitions.
>      */
> -    public void setWebXml( String s ) {
> -        webxmlFile=resolveFile(s).getAbsolutePath();
> -        webxmlLevel=ALL_WEBXML;
> +    public void setWebXml(String s) {
> +        webxmlFile = resolveFile(s).getAbsolutePath();
> +        webxmlLevel = ALL_WEBXML;
>     }
>
>     /**
> @@ -751,19 +758,18 @@
>         return tagPluginManager;
>     }
>
> -    public void generateWebMapping( String file, JspCompilationContext clctxt )
> -        throws IOException
> -    {
> +    public void generateWebMapping(String file, JspCompilationContext clctxt)
> +            throws IOException {
>         if (log.isDebugEnabled()) {
>             log.debug("Generating web mapping for file " + file
> -                      + " using compilation context " + clctxt);
> +                    + " using compilation context " + clctxt);
>         }
>
>         String className = clctxt.getServletClassName();
>         String packageName = clctxt.getServletPackageName();
>
>         String thisServletName;
> -        if  ("".equals(packageName)) {
> +        if ("".equals(packageName)) {
>             thisServletName = className;
>         } else {
>             thisServletName = packageName + '.' + className;
> @@ -787,8 +793,7 @@
>     }
>
>     private void processFile(String file)
> -        throws JasperException
> -    {
> +            throws JasperException {
>         if (log.isDebugEnabled()) {
>             log.debug("Processing file: " + file);
>         }
> @@ -805,9 +810,9 @@
>                 scratchDir = new File(new File(temp).getAbsolutePath());
>             }
>
> -            String jspUri=file.replace('\\','/');
> +            String jspUri = file.replace('\\', '/');
>             JspCompilationContext clctxt = new JspCompilationContext
> -                ( jspUri, false,  this, context, null, rctxt, classLoaderInterface );
> +                    (jspUri, false, this, context, null, rctxt, classLoaderInterface);
>
>             /* Override the defaults */
>             if ((targetClassName != null) && (targetClassName.length() > 0)) {
> @@ -819,8 +824,8 @@
>             }
>
>             originalClassLoader = Thread.currentThread().getContextClassLoader();
> -            if( loader==null ) {
> -                initClassLoader( clctxt );
> +            if (loader == null) {
> +                initClassLoader(clctxt);
>             }
>             Thread.currentThread().setContextClassLoader(loader);
>
> @@ -833,7 +838,7 @@
>             // .jsp file is newer than .class file;
>             // Otherwise only generate .java, if .jsp file is newer than
>             // the .java file
> -            if( clc.isOutDated(compile) ) {
> +            if (clc.isOutDated(compile)) {
>                 if (log.isDebugEnabled()) {
>                     log.debug(jspUri + " is out dated, compiling...");
>                 }
> @@ -842,9 +847,9 @@
>             }
>
>             // Generate mapping
> -            generateWebMapping( file, clctxt );
> -            if ( showSuccess ) {
> -                log.info( "Built File: " + file );
> +            generateWebMapping(file, clctxt);
> +            if (showSuccess) {
> +                log.info("Built File: " + file);
>             }
>
>             this.sourceCode = clctxt.getSourceCode();
> @@ -857,25 +862,26 @@
>             }
>             if (rootCause != je) {
>                 log.error(Localizer.getMessage("jspc.error.generalException",
> -                                               file),
> -                          rootCause);
> +                        file),
> +                        rootCause);
>             }
>
>             // Bugzilla 35114.
> -            if(getFailOnError()) {
> +            if (getFailOnError()) {
>                 throw je;
>             } else {
> -                log.error(je.getMessage(), je);;
> +                log.error(je.getMessage(), je);
> +                ;
>             }
>
>         } catch (Exception e) {
>             if ((e instanceof FileNotFoundException) && log.isWarnEnabled()) {
>                 log.warn(Localizer.getMessage("jspc.error.fileDoesNotExist",
> -                                              e.getMessage()));
> +                        e.getMessage()));
>             }
>             throw new JasperException(e);
>         } finally {
> -            if(originalClassLoader != null) {
> +            if (originalClassLoader != null) {
>                 Thread.currentThread().setContextClassLoader(originalClassLoader);
>             }
>         }
> @@ -892,12 +898,12 @@
>      * @throws JasperException If an error occurs
>      */
>     public void execute() throws JasperException {
> -        if(log.isDebugEnabled()) {
> +        if (log.isDebugEnabled()) {
>             log.debug("execute() starting for " + pages.size() + " pages.");
>         }
>
>         try {
> -            if( context==null ) {
> +            if (context == null) {
>                 initServletContext();
>             }
>
> @@ -906,12 +912,12 @@
>             Iterator iter = pages.iterator();
>             while (iter.hasNext()) {
>                 String nextjsp = iter.next().toString();
> -
> +
>                 processFile(nextjsp);
>             }
>
>             completeWebXml();
> -        }catch (JasperException je) {
> +        } catch (JasperException je) {
>             Throwable rootCause = je;
>             while (rootCause instanceof JasperException
>                     && ((JasperException) rootCause).getRootCause() != null) {
> @@ -932,7 +938,7 @@
>
>     private String nextArg() {
>         if ((argPos >= args.length)
> -            || (fullstop = SWITCH_FULL_STOP.equals(args[argPos]))) {
> +                || (fullstop = SWITCH_FULL_STOP.equals(args[argPos]))) {
>             return null;
>         } else {
>             return args[argPos++];
> @@ -963,7 +969,7 @@
>             if (webxmlLevel >= ALL_WEBXML) {
>                 mapout.write(Localizer.getMessage("jspc.webxml.header"));
>                 mapout.flush();
> -            } else if ((webxmlLevel>= INC_WEBXML)) {
> +            } else if ((webxmlLevel >= INC_WEBXML)) {
>                 mapout.write(Localizer.getMessage("jspc.webinc.header"));
>                 mapout.flush();
>             }
> @@ -993,10 +999,10 @@
>
>     private void initServletContext() {
>
> -            context =new JspCServletContext
> +        context = new JspCServletContext
>                 (new PrintWriter(System.out),
> -                 classLoaderInterface);
> -            tldLocationsCache = new TldLocationsCache(context, true);
> +                        classLoaderInterface);
> +        tldLocationsCache = new TldLocationsCache(context, true);
>
>         rctxt = new JspRuntimeContext(context, this);
>         jspConfig = new JspConfig(context);
> @@ -1011,7 +1017,7 @@
>      * @throws IOException If an error occurs
>      */
>     private void initClassLoader(JspCompilationContext clctxt)
> -        throws IOException {
> +            throws IOException {
>
>         classPath = getClassPath();
>
> @@ -1019,7 +1025,7 @@
>         // Turn the classPath into URLs
>         ArrayList urls = new ArrayList();
>         StringTokenizer tokenizer = new StringTokenizer(classPath,
> -                                                        File.pathSeparator);
> +                File.pathSeparator);
>         while (tokenizer.hasMoreTokens()) {
>             String path = tokenizer.nextToken();
>             try {
> @@ -1035,7 +1041,7 @@
>
>         //TODO: add .tld files to the URLCLassLoader
>
> -        URL urlsA[]=new URL[urls.size()];
> +        URL urlsA[] = new URL[urls.size()];
>         urls.toArray(urlsA);
>         loader = new URLClassLoader(urlsA, this.getClass().getClassLoader());
>
> @@ -1046,13 +1052,13 @@
>      * in both Ant and command-line situations.  If Ant launched
>      * us, we should use the basedir of the current project
>      * to resolve relative paths.
> -     *
> +     * <p/>
>      * See Bugzilla 35571.
>      *
>      * @param s The file
>      * @return The file resolved
>      */
> -     protected File resolveFile(final String s) {
> +    protected File resolveFile(final String s) {
>         //TODO: what to do with this
>         return new File(s);
>     }
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspCompilationContext.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspCompilationContext.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspCompilationContext.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/JspCompilationContext.java Fri Aug 14 21:02:33 2009
> @@ -18,6 +18,8 @@
>  package org.apache.struts2.jasper;
>
>  import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
> +import com.opensymphony.xwork2.util.logging.Logger;
> +import com.opensymphony.xwork2.util.logging.LoggerFactory;
>  import org.apache.struts2.jasper.compiler.Compiler;
>  import org.apache.struts2.jasper.compiler.*;
>  import org.apache.struts2.jasper.servlet.JasperLoader;
> @@ -37,9 +39,9 @@
>  * A place holder for various things that are used through out the JSP
>  * engine. This is a per-request/per-context data structure. Some of
>  * the instance variables are set at different points.
> - *
> + * <p/>
>  * Most of the path-related stuff is here - mangling names, versions, dirs,
> - * loading resources and dealing with uris.
> + * loading resources and dealing with uris.
>  *
>  * @author Anil K. Vijendran
>  * @author Harish Prabandham
> @@ -49,8 +51,7 @@
>  */
>  public class JspCompilationContext {
>
> -    protected org.apache.commons.logging.Log log =
> -        org.apache.commons.logging.LogFactory.getLog(JspCompilationContext.class);
> +    private Logger log = LoggerFactory.getLogger(JspCompilationContext.class);
>
>     private Hashtable tagFileJarUrls;
>     private boolean isPackagedTagFile;
> @@ -119,7 +120,7 @@
>     }
>
>     public JspCompilationContext(String tagfile,
> -                                 TagInfo tagInfo,
> +                                 TagInfo tagInfo,
>                                  Options options,
>                                  ServletContext context,
>                                  JspServletWrapper jsw,
> @@ -135,20 +136,20 @@
>     }
>
>     /* ==================== Methods to override ==================== */
> -
> +
>     /** ---------- Class path and loader ---------- */
>
>     /**
> -     * The classpath that is passed off to the Java compiler.
> +     * The classpath that is passed off to the Java compiler.
>      */
>     public String getClassPath() {
> -        if( classPath != null )
> +        if (classPath != null)
>             return classPath;
>         return rctxt.getClassPath();
>     }
>
>     /**
> -     * The classpath that is passed off to the Java compiler.
> +     * The classpath that is passed off to the Java compiler.
>      */
>     public void setClassPath(String classPath) {
>         this.classPath = classPath;
> @@ -159,7 +160,7 @@
>      * this JSP?
>      */
>     public ClassLoader getClassLoader() {
> -        if( loader != null )
> +        if (loader != null)
>             return loader;
>         return rctxt.getParentClassLoader();
>     }
> @@ -169,22 +170,22 @@
>     }
>
>     public ClassLoader getJspLoader() {
> -        if( jspLoader == null ) {
> +        if (jspLoader == null) {
>             jspLoader = new JasperLoader
> -            (new URL[] {baseUrl},
> -                    getClassLoader(),
> -                    rctxt.getPermissionCollection(),
> -                    rctxt.getCodeSource());
> +                    (new URL[]{baseUrl},
> +                            getClassLoader(),
> +                            rctxt.getPermissionCollection(),
> +                            rctxt.getCodeSource());
>         }
>         return jspLoader;
>     }
>
>     /** ---------- Input/Output  ---------- */
> -
> +
>     /**
>      * Create a "Compiler" object based on some init param data. This
>      * is not done yet. Right now we're just hardcoding the actual
> -     * compilers that are created.
> +     * compilers that are created.
>      */
>     public Compiler createCompiler() throws JasperException {
>         jspCompiler = new CustomCompiler();
> @@ -193,7 +194,7 @@
>     }
>
>     private Compiler createCompiler(String className) {
> -        Compiler compiler = null;
> +        Compiler compiler = null;
>         try {
>             compiler = (Compiler) Class.forName(className).newInstance();
>         } catch (Throwable t) {
> @@ -203,7 +204,7 @@
>         }
>         return compiler;
>     }
> -
> +
>     public Compiler getCompiler() {
>         return jspCompiler;
>     }
> @@ -213,7 +214,8 @@
>     /**
>      * Gets a resource as a stream, relative to the meanings of this
>      * context's implementation.
> -     * @return a null if the resource cannot be found or represented
> +     *
> +     * @return a null if the resource cannot be found or represented
>      *         as an InputStream.
>      */
>     public java.io.InputStream getResourceAsStream(String res) {
> @@ -233,7 +235,7 @@
>         return context.getResourcePaths(canonicalURI(path));
>     }
>
> -    /**
> +    /**
>      * Gets the actual path of a URI relative to the context of
>      * the compilation.
>      */
> @@ -248,9 +250,9 @@
>      * Returns the tag-file-name-to-JAR-file map of this compilation unit,
>      * which maps tag file names to the JAR files in which the tag files are
>      * packaged.
> -     *
> +     * <p/>
>      * The map is populated when parsing the tag-file elements of the TLDs
> -     * of any imported taglibs.
> +     * of any imported taglibs.
>      */
>     public Hashtable getTagFileJarUrls() {
>         return this.tagFileJarUrls;
> @@ -270,7 +272,7 @@
>
>     /**
>      * Just the class name (does not include package name) of the
> -     * generated class.
> +     * generated class.
>      */
>     public String getServletClassName() {
>
> @@ -294,10 +296,10 @@
>     public void setServletClassName(String className) {
>         this.className = className;
>     }
> -
> +
>     /**
>      * Path of the JSP URI. Note that this is not a file name. This is
> -     * the context rooted URI of the JSP file.
> +     * the context rooted URI of the JSP file.
>      */
>     public String getJspFile() {
>         return jspUri;
> @@ -305,7 +307,7 @@
>
>     /**
>      * Are we processing something that has been declared as an
> -     * errorpage?
> +     * errorpage?
>      */
>     public boolean isErrorPage() {
>         return isErrPage;
> @@ -368,11 +370,11 @@
>         if (derivedPackageName == null) {
>             int iSep = jspUri.lastIndexOf('/');
>             derivedPackageName = (iSep > 0) ?
> -                    JspUtil.makeJavaPackage(jspUri.substring(0,iSep)) : "";
> +                    JspUtil.makeJavaPackage(jspUri.substring(0, iSep)) : "";
>         }
>         return derivedPackageName;
>     }
> -
> +
>     /**
>      * The package name into which the servlet class is generated.
>      */
> @@ -382,13 +384,13 @@
>
>     /**
>      * Full path name of the Java file into which the servlet is being
> -     * generated.
> +     * generated.
>      */
>     public String getServletJavaFileName() {
>
>         if (servletJavaFileName == null) {
>             servletJavaFileName =
> -                getServletClassName() + ".java";
> +                    getServletClassName() + ".java";
>         }
>         return servletJavaFileName;
>     }
> @@ -398,7 +400,7 @@
>     }
>
>     /**
> -     * Get hold of the Options object for this context.
> +     * Get hold of the Options object for this context.
>      */
>     public Options getOptions() {
>         return options;
> @@ -422,12 +424,12 @@
>         }
>
>         if (isTagFile()) {
> -           String tagName = tagInfo.getTagClassName();
> +            String tagName = tagInfo.getTagClassName();
>             javaPath = tagName.replace('.', '/') + ".java";
>         } else {
>             javaPath = getServletPackageName().replace('.', '/') + '/' +
> -                       getServletClassName() + ".java";
> -       }
> +                    getServletClassName() + ".java";
> +        }
>         return javaPath;
>     }
>
> @@ -435,13 +437,13 @@
>
>         if (classFileName == null) {
>             classFileName = getServletClassName() + ".class";
> -        }
> +        }
>         return classFileName;
>     }
>
>     /**
>      * Get the content type of this JSP.
> -     *
> +     * <p/>
>      * Content type includes content type and encoding.
>      */
>     public String getContentType() {
> @@ -465,16 +467,16 @@
>
>     /**
>      * Gets the 'location' of the TLD associated with the given taglib 'uri'.
> -     *
> +     *
>      * @return An array of two Strings: The first element denotes the real
> -     * path to the TLD. If the path to the TLD points to a jar file, then the
> -     * second element denotes the name of the TLD entry in the jar file.
> -     * Returns null if the given uri is not associated with any tag library
> -     * 'exposed' in the web application.
> +     *         path to the TLD. If the path to the TLD points to a jar file, then the
> +     *         second element denotes the name of the TLD entry in the jar file.
> +     *         Returns null if the given uri is not associated with any tag library
> +     *         'exposed' in the web application.
>      */
>     public String[] getTldLocation(String uri) throws JasperException {
> -        String[] location =
> -            getOptions().getTldLocationsCache().getLocation(uri);
> +        String[] location =
> +                getOptions().getTldLocationsCache().getLocation(uri);
>         return location;
>     }
>
> @@ -490,21 +492,21 @@
>     public void incrementRemoved() {
>         if (removed > 1) {
>             jspCompiler.removeGeneratedFiles();
> -            if( rctxt != null )
> +            if (rctxt != null)
>                 rctxt.removeWrapper(jspUri);
>         }
>         removed++;
>     }
>
>     public boolean isRemoved() {
> -        if (removed > 1 ) {
> +        if (removed > 1) {
>             return true;
>         }
>         return false;
>     }
>
>     // ==================== Compile and reload ====================
> -
> +
>     public void compile() throws JasperException, FileNotFoundException {
>         createCompiler();
>         if (isPackagedTagFile || jspCompiler.isOutDated()) {
> @@ -520,8 +522,8 @@
>             } catch (Exception ex) {
>                 ex.printStackTrace();
>                 JasperException je = new JasperException(
> -                            Localizer.getMessage("jsp.error.unable.compile"),
> -                            ex);
> +                        Localizer.getMessage("jsp.error.unable.compile"),
> +                        ex);
>                 // Cache compilation exception
>                 jsw.setCompilationException(je);
>                 throw je;
> @@ -535,12 +537,11 @@
>
>  // ==================== Manipulating the class ====================
>
> -    public Class load()
> -        throws JasperException, FileNotFoundException
> -    {
> +    public Class load()
> +            throws JasperException, FileNotFoundException {
>         try {
>             getJspLoader();
> -
> +
>             String name;
>             if (isTagFile()) {
>                 name = tagInfo.getTagClassName();
> @@ -550,10 +551,10 @@
>             servletClass = jspLoader.loadClass(name);
>         } catch (ClassNotFoundException cex) {
>             throw new JasperException(Localizer.getMessage("jsp.error.unable.load"),
> -                                      cex);
> +                    cex);
>         } catch (Exception ex) {
>             throw new JasperException(Localizer.getMessage("jsp.error.unable.compile"),
> -                                      ex);
> +                    ex);
>         }
>         removed = 0;
>         return servletClass;
> @@ -564,66 +565,66 @@
>     static Object outputDirLock = new Object();
>
>     private static final boolean isPathSeparator(char c) {
> -       return (c == '/' || c == '\\');
> +        return (c == '/' || c == '\\');
>     }
>
>     public static final String canonicalURI(String s) {
> -       if (s == null) return null;
> -       StringBuffer result = new StringBuffer();
> -       final int len = s.length();
> -       int pos = 0;
> -       while (pos < len) {
> -           char c = s.charAt(pos);
> -           if ( isPathSeparator(c) ) {
> -               /*
> +        if (s == null) return null;
> +        StringBuffer result = new StringBuffer();
> +        final int len = s.length();
> +        int pos = 0;
> +        while (pos < len) {
> +            char c = s.charAt(pos);
> +            if (isPathSeparator(c)) {
> +                /*
>                 * multiple path separators.
>                 * 'foo///bar' -> 'foo/bar'
>                 */
> -               while (pos+1 < len && isPathSeparator(s.charAt(pos+1))) {
> -                   ++pos;
> -               }
> +                while (pos + 1 < len && isPathSeparator(s.charAt(pos + 1))) {
> +                    ++pos;
> +                }
>
> -               if (pos+1 < len && s.charAt(pos+1) == '.') {
> -                   /*
> +                if (pos + 1 < len && s.charAt(pos + 1) == '.') {
> +                    /*
>                     * a single dot at the end of the path - we are done.
>                     */
> -                   if (pos+2 >= len) break;
> +                    if (pos + 2 >= len) break;
>
> -                   switch (s.charAt(pos+2)) {
> -                       /*
> +                    switch (s.charAt(pos + 2)) {
> +                        /*
>                         * self directory in path
>                         * foo/./bar -> foo/bar
>                         */
> -                   case '/':
> -                   case '\\':
> -                       pos += 2;
> -                       continue;
> -
> -                       /*
> -                        * two dots in a path: go back one hierarchy.
> -                        * foo/bar/../baz -> foo/baz
> -                        */
> -                   case '.':
> -                       // only if we have exactly _two_ dots.
> -                       if (pos+3 < len && isPathSeparator(s.charAt(pos+3))) {
> -                           pos += 3;
> -                           int separatorPos = result.length()-1;
> -                           while (separatorPos >= 0 &&
> -                                  ! isPathSeparator(result
> -                                                    .charAt(separatorPos))) {
> -                               --separatorPos;
> -                           }
> -                           if (separatorPos >= 0)
> -                               result.setLength(separatorPos);
> -                           continue;
> -                       }
> -                   }
> -               }
> -           }
> -           result.append(c);
> -           ++pos;
> -       }
> -       return result.toString();
> +                        case '/':
> +                        case '\\':
> +                            pos += 2;
> +                            continue;
> +
> +                            /*
> +                            * two dots in a path: go back one hierarchy.
> +                            * foo/bar/../baz -> foo/baz
> +                            */
> +                        case '.':
> +                            // only if we have exactly _two_ dots.
> +                            if (pos + 3 < len && isPathSeparator(s.charAt(pos + 3))) {
> +                                pos += 3;
> +                                int separatorPos = result.length() - 1;
> +                                while (separatorPos >= 0 &&
> +                                        !isPathSeparator(result
> +                                                .charAt(separatorPos))) {
> +                                    --separatorPos;
> +                                }
> +                                if (separatorPos >= 0)
> +                                    result.setLength(separatorPos);
> +                                continue;
> +                            }
> +                    }
> +                }
> +            }
> +            result.append(c);
> +            ++pos;
> +        }
> +        return result.toString();
>     }
>  }
>
>
> Modified: struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Options.java
> URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Options.java?rev=804373&r1=804372&r2=804373&view=diff
> ==============================================================================
> --- struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Options.java (original)
> +++ struts/sandbox/trunk/struts2-jsp-plugin/src/main/java/org/apache/struts2/jasper/Options.java Fri Aug 14 21:02:33 2009
> @@ -25,7 +25,7 @@
>  import java.util.Map;
>
>  /**
> - * A class to hold all init parameters specific to the JSP engine.
> + * A class to hold all init parameters specific to the JSP engine.
>  *
>  * @author Anil K. Vijendran
>  * @author Hans Bergsten
> @@ -59,7 +59,7 @@
>      * Should errors be sent to client or thrown into stderr?
>      */
>     public boolean getSendErrorToClient();
> -
> +
>     /**
>      * Should we include debug information in compiled class?
>      */
> @@ -93,7 +93,7 @@
>     public boolean getTrimSpaces();
>
>     /**
> -     * Class ID for use in the plugin tag when the browser is IE.
> +     * Class ID for use in the plugin tag when the browser is IE.
>      */
>     public String getIeClassId();
>
> @@ -121,18 +121,18 @@
>     /**
>      * Compiler source VM, e.g. 1.3, 1.4, or 1.5.
>      */
> -    public String getCompilerSourceVM();
> +    public String getCompilerSourceVM();
>
>     /**
>      * The cache for the location of the TLD's
>      * for the various tag libraries 'exposed'
>      * by the web application.
> -     * A tag library is 'exposed' either explicitely in
> -     * web.xml or implicitely via the uri tag in the TLD
> +     * A tag library is 'exposed' either explicitely in
> +     * web.xml or implicitely via the uri tag in the TLD
>      * of a taglib deployed in a jar file (WEB-INF/lib).
>      *
>      * @return the instance of the TldLocationsCache
> -     * for the web-application.
> +     *         for the web-application.
>      */
>     public TldLocationsCache getTldLocationsCache();
>
> @@ -148,7 +148,7 @@
>     public boolean getFork();
>
>     /**
> -     * Obtain JSP configuration informantion specified in web.xml.
> +     * Obtain JSP configuration informantion specified in web.xml.
>      */
>     public JspConfig getJspConfig();
>
> @@ -166,24 +166,24 @@
>      * Are Text strings to be generated as char arrays?
>      */
>     public boolean genStringAsCharArray();
> -
> +
>     /**
>      * Modification test interval.
>      */
>     public int getModificationTestInterval();
> -
> +
>     /**
>      * Is caching enabled (used for precompilation).
>      */
>     public boolean isCaching();
> -
> +
>     /**
>      * The web-application wide cache for the returned TreeNode
>      * by parseXMLDocument in TagLibraryInfoImpl.parseTLD,
>      * if isCaching returns true.
> -     *
> +     *
>      * @return the Map(String uri, TreeNode tld) instance.
>      */
>     public Map getCache();
> -
> +
>  }
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org