[ 
https://issues.apache.org/jira/browse/VELOCITY-293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Henning Schmiedehausen closed VELOCITY-293.
-------------------------------------------


> velocity.properties and templatePath could not be specified together
> --------------------------------------------------------------------
>
>                 Key: VELOCITY-293
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-293
>             Project: Velocity
>          Issue Type: Bug
>          Components: Anakia
>    Affects Versions: 1.4
>         Environment: Operating System: other
> Platform: PC
>            Reporter: KITORA Masanao
>         Assigned To: Velocity-Dev List
>
> In Ant Anakia task ,
> I counld not specify 'templatePath' attribute
> when velocity.properties file exists.
>  I fixed this problem , please check my patch
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-velocity/src/java/org/apache/velocity/anakia/AnakiaTask.java,v
> retrieving revision 1.38
> diff -u -r1.38 AnakiaTask.java
> --- AnakiaTask.java   20 Mar 2004 03:35:50 -0000      1.38
> +++ AnakiaTask.java   6 Sep 2004 10:01:14 -0000
> @@ -19,10 +19,12 @@
>  import java.io.BufferedWriter;
>  import java.io.File;
>  import java.io.FileOutputStream;
> +import java.io.FileInputStream;
>  import java.io.OutputStreamWriter;
>  import java.io.Writer;
>  
>  import java.util.StringTokenizer;
> +import java.util.Properties;
>  
>  import org.apache.tools.ant.BuildException;
>  import org.apache.tools.ant.DirectoryScanner;
> @@ -259,16 +261,17 @@
>          Document projectDocument = null;
>          try
>          {
> +            Properties vp = new Properties();
>              if ( velocityPropertiesFile.exists() )
>              {
> -                ve.init(velocityPropertiesFile.getAbsolutePath());
> +                vp.load( new
> FileInputStream(velocityPropertiesFile.getAbsolutePath()) );
>              }
> -            else if (templatePath != null && templatePath.length() > 0)
> +            if (templatePath != null && templatePath.length() > 0)
>              {
> -                ve.setProperty( RuntimeConstants.FILE_RESOURCE_LOADER_PATH,
> +                vp.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH,
>                      templatePath);
> -                ve.init();
>              }
> +            ve.init(vp);
>  
>              // get the last modification of the VSL stylesheet
>              styleSheetLastModified = ve.getTemplate( style 
> ).getLastModified();

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to