mikeh       01/07/05 14:55:51

  Modified:    src/java/org/apache/turbine/modules/screens
                        VelocityScreen.java
  Log:
  factored out the "screens" prepending to template name.  Also used
  the value from TurbineConstants
  
  Revision  Changes    Path
  1.15      +10 -7     
jakarta-turbine/src/java/org/apache/turbine/modules/screens/VelocityScreen.java
  
  Index: VelocityScreen.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/screens/VelocityScreen.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- VelocityScreen.java       2001/05/07 14:39:20     1.14
  +++ VelocityScreen.java       2001/07/05 21:55:49     1.15
  @@ -62,6 +62,7 @@
   import org.apache.turbine.services.resources.TurbineResources;
   import org.apache.turbine.services.velocity.TurbineVelocity;
   import org.apache.turbine.services.template.TurbineTemplate;
  +import org.apache.turbine.TurbineConstants;
   
   // Velocity Stuff
   import org.apache.velocity.context.Context;
  @@ -78,7 +79,7 @@
    * class and override the doBuildTemplate() method.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Dave Bryson</a>
  - * @version $Id: VelocityScreen.java,v 1.14 2001/05/07 14:39:20 mpoeschl Exp $
  + * @version $Id: VelocityScreen.java,v 1.15 2001/07/05 21:55:49 mikeh Exp $
    */
   public class VelocityScreen extends TemplateScreen
   {
  @@ -136,20 +137,20 @@
               templateName = '/' + templateName;
           }
   
  +        templateName =  TurbineConstants.SCREENS + templateName;
           try
           {
               // if a layout has been defined return the results, otherwise
               // send the results directly to the output stream.
               if (getLayout(data) == null)
               {
  -                TurbineVelocity.handleRequest(context,
  -                    "screens" + templateName,
  +                TurbineVelocity.handleRequest(context, templateName,
                       data.getResponse().getOutputStream());
               }
               else
               {
  -                screenData = TurbineVelocity
  -                    .handleRequest(context,"screens" + templateName);
  +                screenData = 
  +                    TurbineVelocity.handleRequest(context, templateName);
               }
           }
           catch (Exception e)
  @@ -161,13 +162,15 @@
               context.put ( "stackTrace", StringUtils.stackTrace(e) );
               templateName = TurbineResources.getString(
                   "template.error", "/error.vm");
  +
               if ((templateName.length() > 0) &&
                   (templateName.charAt(0) != '/'))
               {
                   templateName = '/' + templateName;
               }
  -            screenData = TurbineVelocity.handleRequest(
  -                context, "screens" + templateName);
  +
  +            templateName =  TurbineConstants.SCREENS + templateName;
  +            screenData = TurbineVelocity.handleRequest(context, templateName);
           }
   
           // package the response in an ECS element
  
  
  

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

Reply via email to