views:

74

answers:

1

Hello!

I want to create dynamic subdomains on my site. I know how to create it using apache2 mod_rewrite (convert urls like sub.domain.com to domain.com/sub/). But I have one problem: I don't know how my web application learn about this subdomain.

How I can do this using Struts2?

A: 

You can pass it via an http header, configured at mod_rewrite or nginx

splix
how I can do it if I using struts2?
you have 2 ways for this: 1 - make you action ServletRequestAware and get your header from request2 - create an servlet filter, and populate this header to an request attribute/parameter, and then use it inside your form model
splix