>I think (and correct me if I'm wrong) that Karen just wants to use the
> virtual host as the user name for which to generate content, not to
> actually have it be handled by a different action bean or webapp.
That's correct. Although in one instance I also need to differentiate
between the 'www' subdomain (main websites homepage) and the user subdomains
(users custom homepages). Thus forwarding "/" to two different actionBeans.
Not sure, if something like that could also be handled by a reverse proxy
though.
> Why not just grab the 'Host' header from the request? Browsers are
> pretty good at conforming to HTTP/1.1 these days.
I've tested that approach and that seems to work just fine:
@DefaultHandler
public Resolution viewForm() {
String domain = getContext().getRequest().getLocalName();
String subDomain = domain.substring(0, domain.indexOf('.'));
if ( subDomain.toLowerCase().equals("www")) {
return new ForwardResolution(HomepageAction.class); // goto
regular homepage
} else {
return new ForwardResolution(UserAction.class); // goto
subdomain homepage
}
> I don't think it really belongs in the UrlBinding, but it would be
> pretty trivial to extend the dispatcher to set a property from the
> Host, based on some annotation. Actually, some generic way to declare
> request headers to bind (and validate) would be kinda nice.
I agree, but what about the code that generates URL's in Stripes: is that
only the UrlBuilder class? Or does URL generation in Stripes depend also on
other classes? If not, what would be the best way to intergrate you're own
custom UrlBuilder class?
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users