-
1. Re: Themes question
chris1 Aug 29, 2007 10:08 PM (in response to phantom)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!
- Chris -
2. Re: Themes question
chris1 Aug 30, 2007 10:30 PM (in response to phantom)nobody out here who has an idea?
- Christian -
3. Re: Themes question
wise_guybg Aug 31, 2007 2:54 AM (in response to phantom)I guess you could install a custom filter using @Filter:
http://docs.jboss.com/seam/2.0.0.B1/reference/en/html/configuration.html#d0e12795
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(...);
HTH -
4. Re: Themes question
chris1 Sep 1, 2007 8:24 AM (in response to phantom)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 throwsjava.lang.NullPointerException at org.jboss.seam.theme.ThemeSelector.select(ThemeSelector.java:87)
The annotations in my custom filter class are:
@Startup
@Scope(ScopeType.APPLICATION)
@Name("de.dvdb.generic.seam.ThemeFilter")
@Intercept(InterceptionType.NEVER)
@Filter(within = "org.jboss.seam.web.contextFilter")
Is this ok?
- Chris