Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.
 
Does this tiny ad smell okay to you?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic