permaculture playing cards*
The moose likes Struts and the fly likes struts-config change/redeploy application object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts-config change/redeploy application object" Watch "struts-config change/redeploy application object" New topic
Author

struts-config change/redeploy application object

azhar bharat
Ranch Hand

Joined: Jul 17, 2006
Posts: 87
Hi
If I change the struts-config xml file, do i have to redeploy the application for the changes in config file to take effect?

The problem is, if i redeploy the application, some data in the application object, representing the state of the application will be lost.

Do I have to manually backup the data and re-populate in the application object after redepolyment? Or is there any other way automate the process?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If I change the struts-config xml file, do i have to redeploy the application for the changes in config file to take effect?

Yes, you do. There's no getting around it.
The problem is, if i redeploy the application, some data in the application object, representing the state of the application will be lost.

It's not a good design to rely on the Application (ServletContext) object for persistent data. It's fine to use this object as a kind of cache to keep the number of database hits low, but anything you want to keep should be written to a database first and then cached in the Applicaiton object. The server could go down unexpectedly at any time. A good design plans for that possibility. Data written to a relational database is recoverable if the server fails. Data in memory is not.
[ August 12, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts-config change/redeploy application object