• 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

Storing the Struts config file to the database

 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of reading the paths from the XML file, could we read it from a database instead? That way, I don't have to restart my application if I need to change a URL. However, there're the network load of querying the database for the URLs involved.

Nevertheless, is this possibly currently?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In order to do this you would have to:

1-Get the source code for the version of struts you're using. It's available at The struts home page.
2-Subclass the ActionServlet and possibly the RequestProcessor classes so that the configuration information is read from a database instead of the struts-config.xml file.
3-Change the web.xml file so that your subclass is now the class specified for the action servlet.
4-Create a process that would update the in-memory configuration every n minutes.
reply
    Bookmark Topic Watch Topic
  • New Topic