You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org> on 2007/03/08 01:10:39 UTC

[jira] Closed: (VELOCITY-140) VelocityServlet should use getResourceAsStream in loadConfiguration()

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

Henning Schmiedehausen closed VELOCITY-140.
-------------------------------------------


> VelocityServlet should use getResourceAsStream in loadConfiguration()
> ---------------------------------------------------------------------
>
>                 Key: VELOCITY-140
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-140
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.3-rc1
>         Environment: Operating System: All
> Platform: All
>            Reporter: Anthony Kay
>         Assigned To: Anthony Kay
>         Attachments: vs.diff
>
>
> The current source (in both 1.3.1rc2 and nightly) for VelocityServlet uses
> direct file access to get to the velocity properties in a web app. Most
> containers will allow this, but I have found at least one place where this
> breaks things: Tomcat remote deployment.
> The Tomcat system has a set of Ant tasks that allow you to deploy a webapp
> without manually copying the file into a webapps directory, when you deploy with
> this method, the file technique in VelocityServlet will fail. The following
> build file excerpt (depends on catalina-ant.jar) shows the technique:
>    ... snip snip ...
>    <!-- These properties are used for dealing with Tomcat -->
>    <property name="war.file"        value="config_sample"/>
>    <property name="war.file.name"   value="${war.file}.war"/>
>    <property name="war.path"  
> value="f:/opensrc/jakarta-velocity-tools/view/examples"/>
>    <property name="manager.url"      value="http://localhost:8080/manager"/>
>    <property name="tomcat.username" value="awkay"/>
>    <property name="tomcat.password" value="test"/>
>    <property name="contextpath" value="/simple"/>
>    <taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"/>
>    <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"/>
>    ... snip snip ...
>    <target name="redeploy" depends="war, undeploy, deploy"/>
>    <target name="undeploy">
>       <undeploy url="${manager.url}" username="${tomcat.username}" 
>                 password="${tomcat.password}" path="${contextpath}"/>
>    </target>
>    <target name="deploy" depends="war">
>       <deploy url="${manager.url}" username="${tomcat.username}" 
>               password="${tomcat.password}" path="${contextpath}"
>               war="file:///${war.path}/${war.file.name}"/>
>    </target>
> Direct file access fails, because tomcat doesn't bother putting the files in the
> same directory system (webapps) as manually deployed apps. I do not consider
> this a tomcat bug, since there is no problem accessing the contents of the
> webapp programmatically, as long as you use the getResource*() methods as
> recommended in the Servlet Spec.
> I have a patch, and will attach it as soon as I get a CVS copy of 1.3.1rc2.

-- 
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: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org