• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Create subclass of struts ActionServlet that supports "classpath:" config file paths.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Create subclass of struts ActionServlet that supports "classpath:" config file paths.


We use Spring throughout the web app, and we define beans in several different
spring XML files.. the web app loads spring from these files using a Web app
startup listener provided by Spring called
org.springframework.web.context.ContextLoaderListener (you can find source code
online)....
This listener allows us to define the config files as being located "somewhere
on the classpath" by prepending "classpath:" to the file name. So, in web.xml,
we also have this:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext-service.xml,
classpath:applicationContext-punchout.xml,
classpath:search-dao.xml,
classpath:database.xml</param-value>
</context-param>

This way, the config files don't have to be packaged with the WAR, instead they
are packed in the JARs that contain the actual classes referenced in the config
files...
We want to do the act same thing, but with the struts-config.xml file.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic