• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing the Struts config file to the database  RSS feed

 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!