Basically I have a similar requirement. Not on request.agent but on request.servername.
How can I automagically make the shown skin dependent on facesContext.externalContext.request.serverName without any user interaction?
I'm currently developing a multi-user, multi-domain site with seam - seam is unbelievable. Thanks guys for this great piece of software!
nobody out here who has an idea?
I guess you could install a custom filter using @Filter:
Detect the spider. (Chris has given some clues on how to do that)
Change the theme accordingly, using the themeSelector component. Example:
@In ThemeSelector themeSelector; ... themeSelector.selectTheme(...);
I installed a custom filter (@Filter(within = "org.jboss.seam.web.contextFilter")) and the filter is called as expected.
I can also get and access the ThemeSelector via
Context ctx = new SessionContext(new ServletRequestSessionMap(sreq));
ThemeSelector ts = (ThemeSelector) ctx.get(ThemeSelector.class);
Problem is that I get a NPE when setting a theme. selectTheme throws
java.lang.NullPointerException at org.jboss.seam.theme.ThemeSelector.select(ThemeSelector.java:87)
The annotations in my custom filter class are:
@Filter(within = "org.jboss.seam.web.contextFilter")
Is this ok?