Hi All,

I was able to get this to work for a tomcat deployment by adding the
"\WEB-INF\classes\ as shown in the code snippet below but this obviously
won't work with jetty for testing and is not generic. I'm sure there must be
a simple generic way to accomplish this using Wicket classes but I haven't
found anything in the archives that gives me a clue.

Any help in coming up with a generic solution would be appreciated!

Jim

Code Snippet:
String propsPath = PackageResource.get( ReportsPage.class, "ReportsPage.xml"
).getAbsolutePath();
File file = new File ( DemoApp.get().getServletContext().getRealPath(
"/WEB-INF/classes/" + propsPath ));
String absPath = file.getAbsolutePath();
StringBuffer sbuf = ....   // create the xml
Writer out = new BufferedWriter( new OutputStreamWriter( new
FileOutputStream( absPath ), "UTF8" ));
out.write( sbuf.toString());


jnorris wrote:
> 
> Hi all,
> 
> Does anyone know if it is possible to dynamically modify a property file
> or overwrite it using Wicket?  The property files are all in .xml format
> and the keys are taken from a database when a tree is dynamically built
> based on the values read in.  The keys are used in a StringResourceModel
> to provide the text for the tree nodes.  On another page, the admin user
> can add/edit new entries and I would like to also have the new or revised
> key-value data items written to the property file(s) (including supported
> locales) at the same time.  The app deployment is expanded.  I know I can
> get the path starting with the package nameusing getAbsolutePath() on a
> PackageResource but I'm not sure how to get the full path from the root
> folder.
> 
> Thanks,
> Jim
> 

-- 
View this message in context: 
http://www.nabble.com/Dynamic-updating-of-property-file-tp16146867p16148601.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to