|
From: <tri...@tr...> - 2003-05-20 05:21:13
|
To All,
I went back to modify Ken's demo app to use Jürgen's JndiDataSourceBean and to
run with the latest version of the framework code from CVS.
Again, I had to make just a few changes, but this time I did not touch any of
Ken's original Java code. I only modified three of the deployment xml files.
This really shows how valuable a well designed framework is.
These are the changes I made to the original code from Ken's Petclinic1.zip
(Steps 2, 3 and 6 are the same as last time):
1. Removed the <servlet> entry for ContextLoaderServlet from web.xml. This
class has recently been removed from CVS. Replaced it with a <listener> entry.
<listener>
<listener-class>com.interface21.web.context.ContextLoaderListener</listener-class>
</listener>
2. Added a 'resource-ref' entry to web.xml. It goes at the end after
the <taglib> entries.
<resource-ref>
<description>The default DS</description>
<res-ref-name>jdbc/SpringDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
3. Created a jboss-web.xml file with the corresponding 'resource-ref'
entry pointing to the HSQL default datasource.
<jboss-web>
<resource-ref>
<res-ref-name>jdbc/SpringDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<jndi-name>java:/DefaultDS</jndi-name>
</resource-ref>
</jboss-web>
4. Changed the "bean" entry for "dataSource" in the
applicationContext.xml - it now uses the new JndiDataSourceBean.
<beans>
<!-- ===========================================================-->
<!-- Global Message source. For all servlets. -->
<!-- ===========================================================-->
<bean name="messageSource"
class="com.interface21.context.support.ResourceBundleMessageSource">
<property name="basename">messages</property>
</bean>
<bean name="dataSource"
class="com.interface21.jdbc.datasource.JndiDataSourceBean" >
<property name="name">jdbc/SpringDS</property>
</bean>
</beans>
5. Replaced the WEB-INF/lib/spring-full-0.8.jar with the latest version.
6. Created a "petclinic.war" directory under the
"c:\jboss-3.2.1\server\default\deploy" directory and deployed the application there.
That's it for this time.
I have attached a zip file with the changed xml files.
--Thomas
|