You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nate Drake <nd...@gmail.com> on 2007/01/05 19:27:07 UTC
[s2] Issue with custom ResourceBundle using Struts 2.0.2/XWork2 RC1
I originally posted this question on the new XWork user forums [1], but it
doesn't seem to be frequented very much. I apologize in advance if this is bad
form.
We've created a custom ResourceBundle subclass that gets messages from a
database for our Struts2 application. When using Struts 2.0.1 (XWork2 beta 1),
things seem to work well. Only one instance of our ResourceBundle is created and
used for message lookups. In the process of updating to use the Struts 2.0.2
(XWork 2 RC1) test build from 12/31, we've found that each time a message is
looked up, a new instance of our ResourceBundle class is being created. Is this
the expected behavior, or could it be a bug in our application? I haven't
started digging around in the XWork code yet, but that is where I'm heading next.
Thanks!
Nate
[1] http://forums.opensymphony.com/thread.jspa?threadID=56608&tstart=0
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [s2] Issue with custom ResourceBundle using Struts 2.0.2/XWork2 RC1
Posted by Nate Drake <nd...@gmail.com>.
Found out the problem. I had struts.devMode=true in my configuration. This
causes resource bundles to be reloaded with each request. Turning devMode off
makes thing work correctly.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [s2] Issue with custom ResourceBundle using Struts 2.0.2/XWork2 RC1
Posted by Nate Drake <nd...@gmail.com>.
I've created two test WARs based on the struts2-blank WAR that demonstrate the
issue. struts-blank-201.war uses Struts 2.0.1, and struts-blank-203.war uses
code from subversion as of ~9AM EST this morning.
The changes to each include the following:
o A custom ResourceBundle (TestBundle)
o Removal of resource property files
o Addition of struts.properties files to declare the custom ResourceBundle
When running the 2.0.1 based WAR, two instances of TestBundle are created, but
after that no new instances are created. When running the 2.0.3 based WAR, every
message lookup causes a new instance to be created.
You can download the WARs from:
http://www.slimeslurp.net/s2
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org