[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[gyrex-dev] Having a Servlet and a Resource with the same "/" (Root) Alias
|
Hi Gunnar,
a question regarding the aliases of servlets and resources and what the best solution would be:
My Problem:
3. to achieve 2. I have registered a new Servlet with the alias "/" which also points to the same WelcomeController servlet. That works, but see 4.
4. I also have a resource registered for the alias "/" which points to my public folder to get images and css etc.
When I now call
http://localhost:8080/mysampleapp1/ I see the output of the WelcomeController which is what I expect. But it also seems that the "/" resource isn't working anymore, because now my image on that page doesn't display anymore.
How can I achieve that I have something like a default servlet for the alias "/" and also having all my resources also under this alias "/" ?
Here are the extension points of the plugin.xml of my example app. I am only talking about application1 here.
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.gyrex.http.applications">
<application
contextPath="/christoph"
id="org.eclipse.gyrex.sample1.application1">
</application>
<mount
applicationId="org.eclipse.gyrex.sample1.application1"
url="">
</mount>
<servlet
alias="/"
applicationId="org.eclipse.gyrex.sample1.application1"
class="org.eclipse.gyrex.sample1.WelcomeController">
</servlet>
<servlet
alias="/welcome"
applicationId="org.eclipse.gyrex.sample1.application1"
class="org.eclipse.gyrex.sample1.WelcomeController">
</servlet>
<mount
applicationId="org.eclipse.gyrex.sample1.application2"
url="">
</mount>
<servlet
alias="/welcome"
applicationId="org.eclipse.gyrex.sample1.application2"
class="org.eclipse.gyrex.sample1.WelcomeController">
</servlet>
<application
contextPath="/gunnar"
id="org.eclipse.gyrex.sample1.application2">
</application>
<resource
alias="/"
applicationId="org.eclipse.gyrex.sample1.application1"
path="public/">
</resource>
</extension>
</plugin>
Thanks
Christoph
Back to the top