You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jv...@apache.org on 2001/09/15 18:37:04 UTC

cvs commit: jakarta-turbine-3/src/java/org/apache/turbine Turbine.java TurbineConstants.java

jvanzyl     01/09/15 09:37:04

  Modified:    src/java/org/apache/turbine Turbine.java
                        TurbineConstants.java
  Log:
  - turbine 3.x now works in cvslayout mode, the logging system needs
    a slight tweaking but the app is working in a directory structure
    parallel to the tdk directory structure.
  
  Revision  Changes    Path
  1.5       +15 -8     jakarta-turbine-3/src/java/org/apache/turbine/Turbine.java
  
  Index: Turbine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/Turbine.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Turbine.java	2001/09/03 02:01:59	1.4
  +++ Turbine.java	2001/09/15 16:37:04	1.5
  @@ -111,7 +111,7 @@
    * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
  - * @version $Id: Turbine.java,v 1.4 2001/09/03 02:01:59 jvanzyl Exp $
  + * @version $Id: Turbine.java,v 1.5 2001/09/15 16:37:04 jvanzyl Exp $
    */
   public class Turbine
       extends HttpServlet
  @@ -165,18 +165,16 @@
   
               try
               {
  -                // Setup static configuration (using default
  -                // properties file).
  -                String trProps =
  -                    config.getInitParameter(TurbineConfig.PROPERTIES_KEY);
  +                // Setup static configuration (using default properties file).
  +                String trProps = config.getInitParameter(TurbineConfig.PROPERTIES_KEY);
                   configure(config, config.getServletContext(), trProps);
               }
               catch ( Exception e )
               {
                   // save the exception to complain loudly later :-)
                   initFailure = e;
  -                Log.info("Turbine: init() failed: " +
  -                         StringUtils.stackTrace(e));
  +                Log.info("Turbine: init() failed: " + StringUtils.stackTrace(e));
  +                System.err.println(StringUtils.stackTrace(e));
                   return;
               }
               Log.info("Turbine: init() Ready to Rumble!");
  @@ -504,8 +502,17 @@
                                                 String propsFile)
           throws Exception
       {
  +        // Set the application root. This defaults to the webapp
  +        // context if not otherwise set.
  +        applicationRoot = config.getInitParameter(APPLICATION_ROOT);
  +                
  +        if (applicationRoot == null || applicationRoot.equals("webContext"))
  +        {
  +            applicationRoot = config.getServletContext().getRealPath("");
  +        }                    
  +        
           // Set the applicationRoot for this webapp.
  -        setApplicationRoot(context.getRealPath("/"));
  +        setApplicationRoot(applicationRoot);
   
           // Get the full path to the properties file.
           if (propsFile == null)
  
  
  
  1.3       +6 -0      jakarta-turbine-3/src/java/org/apache/turbine/TurbineConstants.java
  
  Index: TurbineConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/TurbineConstants.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TurbineConstants.java	2001/09/14 01:03:24	1.2
  +++ TurbineConstants.java	2001/09/15 16:37:04	1.3
  @@ -313,4 +313,10 @@
        */
       public static final String BASEDIR_KEY = "basedir";
   
  +    /**
  +     * Application root key that can be used in the deployment
  +     * descriptor to change the root directory where a turbine
  +     * application runs from.
  +     */
  +    public static final String APPLICATION_ROOT = "applicationRoot";
   }
  
  
  

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