Vidar Ramdal schrieb: > On Tue, Apr 27, 2010 at 12:24 PM, Markus Blaurock <[email protected]> wrote: > >> Hello, >> >> currently we have the need to run multiple websites on the same >> sling-instance. That is, serving the same or similar content in >> different ways, defined by the hostname. >> For this we would like to have a single pool of sling-app-servers and >> each one should be possible to serve all websites. Otherwise we would >> need to have one pool for each (small) site, which is not feasible. >> >> Our solution was to patch the sling SevletResolver (2.0.9) to accompany >> each entry in the search-path with a hostname (defined by a regular >> expression). >> Resolving a servlet would now evaluate the hostname to "create" a >> specific search-path for this hostname (with entries valid for this >> hostname). >> Probably this could be named "virtual hosts"? >> >> Whith this some questions arise for us: >> >> 1. does somebody have a similar requirement of running multiple websites >> on the same sling instance? Somebody like to share experience? >> >> 2. is there another possible (easier?) solution for our problem? >> >> 3. would this be a feature for sling in general? >> >> What do you think? >> > > Hi Markus; > > Already Sling supports at least parts of your requirements. > Take a look at: > http://sling.apache.org/site/mappings-for-resource-resolution.html > > > Hi Vidar,
we thought of that, but it only works for the first request coming from the server. e.g. if we include another resource inside a resource then the hostname is no longer available and the default servlets will be found. The ResourceResolver.resolve()-Method gets called with null HttpRequest-Parameter (in Sling-Jsp-Tag-Support) - the ServerletResolver.resolveServlet()-Method gets called every time with the HttpRquest and we just used it. Probably providing the HttpRequest to the ResourceResolver every time is also a valid solution to this problem? But OTOH with the /etc/map-solution there is no fallback if a resourceType does not have a specific servlet in a particular virtualHost... regards, markus
