Re: Barracuda: Html template compilation and classes reloading
"Diez B. Roggisch" <[email protected]>
| Newsgroups | gmane.comp.java.enhydra.barracuda.general |
|---|---|
| Message-ID | <[email protected]> |
Etienne Hilson wrote: > Hello everybody. > I don't find any posts about it, so here is my question. > I think I've read when I discovered Barracuda/Xmlc > that it's possible to modify/compile the html templates on the fly, > without restarting the application. > > Is it a dream or not ? > > Can we, without having to restart the running application > -) Compile with xmlc a new html template into a template java class > -) Deploy this new class > -) "Replace" (?) the instance of the old one with an instance of the new one > ? > > If some people have already managed this situation successfully, > I should be very pleased to hear their comments > and if possible, some code snippets or useful links > > Thank you, and all my best success and happiness wishes for this new year ! > (Hey yes, it's my first 2003 post) Hi, we neveractually tried it that way, but we went part of the road for other reasons: XMLC has a nice feature that allows you to create an interface based on a HTML page. Now what class exactly is implementing this the code obviously doesn't care. We used this to add multiple browser support: We arranged XMLC classes in packages dependent on their browser-support. Then we used a factory pattern and loaded the correct implementation at runtime: com.foo.baz.Page - interface com.foo.baz.PageImpl - default (IE) com.foo.baz.n6.PageImpl - Mozilla/IE6 And so on... What we didn't try out was to use XMLC on the fly compiling feature, as this needs runtime directory access to the HTML templates. But using the described factory pattern and the feature described here http://xmlc.enhydra.org/software/documentation/autorecomp.html it should be possible. Diez _______________________________________________ Barracuda mailing list [email protected] http://www.enhydra.org/mailman/listinfo.cgi/barracuda FAQ - http://www.jguru.com/faq/Barracuda