> Say I have several different sites with their own designs, and I want
> to use the same basic WebPage/Panel/Application classes. Ideally, each
> site would be deployable as a war file. How might I package different
> HTML per war to accomplish this?

If you have a limited/ set number of styles, you can use the same
'trick' as you can use for localization. If you look at
wicket-examples/forminput you see a bunch of files like
FormInput_de.html, FormInput_zh_CN.html, etc. These are automatically
picked up according to the active locale in your session. A similar
mechanism independent of the locale exists with Session.style, which
applies to all pages accessed in one session, and on top of that
(appended to style if you have that set), you can override
getVariation in your page/ panel/ fragment/ border so that only for
that component a alternative will be looked for.

If that doesn't give you enough flexibility, you can use custom markup
loading. Look at wicket.examples.customresourceloading for an example
of that. Custom loading on a component level (by overriding
MarkupContainer#newMarkupResourceStream) is limited in 1.2.x in that
it doesn't give you any control over the caching, so once you let a
component load it's markup, you can't do it differently next time. In
Wicket 2.0 (trunk), this is fixed (method getMarkupResourceStream,
look in the same example), but we're probably not going to backport it
to 1.3 unless there is a high demand for it.

> Question 2: if I were to use a Wicket/Spring/Hibernate (JPA) stack, I
> assume using the old trick of using a Servlet Filter to implement the
> 'One Hibernate Session per Request' trick still applies? Is there a
> better pattern for Wicket to handle lazy loading problems?

That still seems to be the common approach, as it is easy. If you
want, you can use a custom request cycle, which basically would do the
same, but in the scope of Wicket. It would give you a bit more control
over what to exclude etc.

About what to do with transactions is a thing more people disagree
about. Some people like to do one transaction per request too, but I
am working on a project where the transactions are explicitly declared
(using Spring annotations). If you look in the archives
(http://www.nabble.com/Wicket-f13974.html) you can find several recent
discussions on this.

> Thanks in advance, and kudos to your exciting new framework.

Cheers. It's actually not *that* new anymore (Wicket is 2.5 years old
now), but I guess relatively it is young :)


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Wicket-user mailing list

Reply via email to