Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Mapping all URLs to one servlet
Mapping all URLs to one servlet [message #85272] Tue, 27 March 2007 05:48 Go to next message
Jeff Norris is currently offline Jeff NorrisFriend
Messages: 11
Registered: July 2009
Junior Member
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 #85345 is a reply to message #85272] Tue, 27 March 2007 11:28 Go to previous messageGo to next message
Richard Backhouse is currently offline Richard BackhouseFriend
Messages: 19
Registered: July 2009
Junior Member
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
Re: Mapping all URLs to one servlet [message #85432 is a reply to message #85345] Tue, 27 March 2007 15:48 Go to previous message
Jeff Norris is currently offline Jeff NorrisFriend
Messages: 11
Registered: July 2009
Junior Member
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
Previous Topic:Re: how to get a bundle's root file path?
Next Topic:Monitoring Incubator Bundles and JMX Access Restrictions
Goto Forum:
  


Current Time: Thu Apr 25 19:44:43 GMT 2024

Powered by FUDForum. Page generated in 0.03103 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top