costin      2002/06/20 15:48:44

  Modified:    jasper2/src/share/org/apache/jasper
                        EmbededServletOptions.java
  Log:
  A quick hack to get the validating flag into ParserUtils. It's not the right
  way, but I hope ParserUtil will be refactored ( I see no point of having
  2 trees - DOM and the mini-DOM, there are plenty of solutions - digester,
  mapper, plain dom, etc ).
  
  Revision  Changes    Path
  1.7       +32 -4     
jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java
  
  Index: EmbededServletOptions.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/EmbededServletOptions.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- EmbededServletOptions.java        12 Jun 2002 23:18:50 -0000      1.6
  +++ EmbededServletOptions.java        20 Jun 2002 22:48:44 -0000      1.7
  @@ -69,6 +69,9 @@
   import org.apache.jasper.logging.Logger;
   
   import org.apache.jasper.compiler.TldLocationsCache;
  +import org.apache.jasper.xmlparser.ParserUtils;
  +
  +import java.util.*;
   
   /**
    * A class to hold all init parameters specific to the JSP engine. 
  @@ -78,7 +81,8 @@
    * @author Pierre Delisle
    */
   public final class EmbededServletOptions implements Options {
  -
  +    private Properties settings=new Properties();
  +    
       /**
        * Is Jasper being used in development mode?
        */
  @@ -160,6 +164,14 @@
        */
       private String javaEncoding;
   
  +    public String getProperty(String name ) {
  +        return settings.getProperty( name );
  +    }
  +
  +    public void setProperty(String name, String value ) {
  +        settings.setProperty( name, value );
  +    }
  +    
       /**
        * Are we keeping generated code around?
        */
  @@ -250,6 +262,10 @@
        return tldLocationsCache;
       }
   
  +    public void setTldLocationsCache( TldLocationsCache tldC ) {
  +        tldLocationsCache=tldC;
  +    }
  +
       public String getJavaEncoding() {
        return javaEncoding;
       }
  @@ -259,6 +275,18 @@
        * ServletConfig and ServletContext. 
        */
       public EmbededServletOptions(ServletConfig config, ServletContext context) {
  +        Enumeration enum=config.getInitParameterNames();
  +        while( enum.hasMoreElements() ) {
  +            String k=(String)enum.nextElement();
  +            String v=config.getInitParameter( k );
  +
  +            setProperty( k, v);
  +        }
  +
  +        // quick hack
  +        String validating=config.getInitParameter( "validating");
  +        if( "false".equals( validating )) ParserUtils.validating=false;
  +        
           String keepgen = config.getInitParameter("keepgenerated");
           if (keepgen != null) {
               if (keepgen.equalsIgnoreCase("true"))
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to