Mapping all URLs to one servlet [message #85272] |
Tue, 27 March 2007 01:48  |
Eclipse User |
|
|
|
First, many thanks for the work that you're doing on Server-Side
Equinox. It's opening up a whole new world of possibilities for us.
I understand that servlet filters aren't supported by Equinox (bug
#128068), but is it possible via some other means for me to have Equinox
direct *all* URLs to one servlet? I'm trying to use Equinox with the
Restlet API to create some REST web services that depend on Eclipse
plugins and I need to do the equivalent of the following web.xml (from
the Restlet FAQ):
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Test servlet</display-name>
<context-param>
<param-name>org.restlet.application</param-name>
<param-value>
com.testServlet.TestServletApplication
</param-value>
</context-param>
<!-- Restlet adapter -->
<servlet>
<servlet-name>ServerServlet</servlet-name>
<servlet-class>
com.noelios.restlet.ext.servlet.ServerServlet
</servlet-class>
</servlet>
<!-- Catch all requests -->
<servlet-mapping>
<servlet-name>ServerServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
In other words, I want Equinox to map ALL URLs to the ServerServlet
servlet. I wish I could just extend the
org.eclipse.equinox.http.registry.servlets extension point with a
servlet alias of "*", but that doesn't work.
Is there a way for me to work around this issue? Some way to easily
replace the mechanism that Equinox uses to delegate work to servlets,
perhaps?
Thank you!
Jeff
|
|
|
|
Re: Mapping all URLs to one servlet [message #85432 is a reply to message #85345] |
Tue, 27 March 2007 11:48  |
Eclipse User |
|
|
|
Richard,
That's exactly what I was looking for - thanks!
Jeff
Richard Backhouse wrote:
> Jeff
>
> You register the alias of the servlet to be "/". You can do this via the
> extension point
>
> <extension point="org.eclipse.equinox.http.registry.servlets">
> <servlet alias="/" class="myservlet.Servlet">
> </servlet>
> </extension>
>
> Richard
>
> Jeff Norris wrote:
>> First, many thanks for the work that you're doing on Server-Side
>> Equinox. It's opening up a whole new world of possibilities for us.
>>
>> I understand that servlet filters aren't supported by Equinox (bug
>> #128068), but is it possible via some other means for me to have
>> Equinox direct *all* URLs to one servlet? I'm trying to use Equinox
>> with the Restlet API to create some REST web services that depend on
>> Eclipse plugins and I need to do the equivalent of the following
>> web.xml (from the Restlet FAQ):
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>> <!DOCTYPE web-app PUBLIC
>> "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>> "http://java.sun.com/dtd/web-app_2_3.dtd">
>> <web-app>
>> <display-name>Test servlet</display-name>
>> <context-param>
>> <param-name>org.restlet.application</param-name>
>> <param-value>
>> com.testServlet.TestServletApplication
>> </param-value>
>> </context-param>
>>
>> <!-- Restlet adapter -->
>> <servlet>
>> <servlet-name>ServerServlet</servlet-name>
>> <servlet-class>
>> com.noelios.restlet.ext.servlet.ServerServlet
>> </servlet-class>
>> </servlet>
>>
>> <!-- Catch all requests -->
>> <servlet-mapping>
>> <servlet-name>ServerServlet</servlet-name>
>> <url-pattern>/*</url-pattern>
>> </servlet-mapping>
>> </web-app>
>>
>> In other words, I want Equinox to map ALL URLs to the ServerServlet
>> servlet. I wish I could just extend the
>> org.eclipse.equinox.http.registry.servlets extension point with a
>> servlet alias of "*", but that doesn't work.
>>
>> Is there a way for me to work around this issue? Some way to easily
>> replace the mechanism that Equinox uses to delegate work to servlets,
>> perhaps?
>>
>> Thank you!
>> Jeff
|
|
|
Powered by
FUDForum. Page generated in 0.03380 seconds