struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Mutiso 2 <a...@utilitynet.net>
Subject making struts and velocity share the same datasource
Date Tue, 22 Oct 2002 15:30:34 GMT
Hi folks,

I am trying to use velocity templates from a database within a struts
application. I have configured velocity to use the
"org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader"
resouce loader, but my templates are never found. I suspect this is because
I cannot tell velocity the correct name of the datasource.

Anyone have some insight as to how to configure velocity to find the same
datasouce that struts is using. My struts config has the typical 

<data-sources>
  <data-source>
   <set-property property="description" value="App Name"/>
   <!--<set-property property="key" value="Myapp"/>-->
   <set-property property="driverClass" value="my.data.driver"/>
   <set-property property="url" value="jdbc:my.db.url"/>
   <set-property property="user" value="myuser"/>
   <set-property property="password" value="mypassword"/>
  </data-source>
<data-sources>

On a secondary issue: If I se the data-source key property to a string, say
"MyAppDataSource" and use it in my Action classes to get the datasource, it
fails. If it use the default name "Action.DATA_SOURCE_KEY" it works. Why am
I not able to use my own name.

I am using struts 1.1-b2

Thanks for the help.

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message