Prev | Current Page 230 | Next

Frank Zammetti

"Practical DWR 2 Projects"

xml file, applicationContext.xml, depending on which version of Spring
you use (which is where you configure your Spring beans), and instantiate it.
All you need to do is create an entry such as the following in dwr.xml:



The beanName parameter specifies the name of the bean as configured in beans.xml. Everything
else works in the same way as you are already familiar with.
There is one other part to this equation, and that??™s finding your Spring configuration.
There are a number of ways to do this, but perhaps the easiest is to add a listener to your
webapp configuration like so:

contextConfigLocation
/WEB-INF/classes/beans.xml



org.springframework.web.context.ContextLoaderListener


When the application starts up, this listener will execute and will configure Spring using
the configuration file pointed to by the context parameter. Once that??™s done, you??™re all set!
An alternative approach is to use an extra location parameter in the dwr.


Pages:
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242