Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Servlet Mapping in Equinox Webapp
Servlet Mapping in Equinox Webapp [message #80701] Thu, 11 January 2007 16:28 Go to next message
Eclipse UserFriend
Originally posted by: jason.duley.gmail.com

Hi,
I have a web application where I defined the following items in plugin.xml ...

<extension point="org.eclipse.equinox.http.registry.servlets">
<servlet alias="/ajax" class="org.foo.bar.MyServlet"/>
</extension>

<!-- html pages -->
<extension
point="org.eclipse.equinox.http.registry.resources">
<resource alias="/" base-name="/web_files"/>
</extension>

given these two items, I want to configure the app such that a request to the html page:

"http://myserver.org/html_files/myhtml.html"

will first be intercepted by the servlet (defined by /ajax). What is the best way to accomplish this in the equinox framework?
Thanks.
Jason
Re: Servlet Mapping in Equinox Webapp [message #80757 is a reply to message #80701] Thu, 11 January 2007 22:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jason.duley.gmail.com

these are the items, sorry about that:

< extension
point="org.eclipse.equinox.http.registry.servlets">
< servlet
alias="/ajax"
class="org.foo.bar.MyServlet"/>
</ extension>


< extension
point="org.eclipse.equinox.http.registry.resources">
< resource
alias="/"
base-name="/web_files"/>
</ extension>
Re: Servlet Mapping in Equinox Webapp [message #80769 is a reply to message #80757] Thu, 11 January 2007 22:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jason.duley.gmail.com

for some reason my tags are being chopped. these entries are within extention tags in the plugin.xml.
Re: Servlet Mapping in Equinox Webapp [message #80781 is a reply to message #80701] Fri, 12 January 2007 01:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: skaegi.sympatico.ca

Hi Jason,

I'm unsure what you're asking for.
Are you looking for a ServletFilter to be applied before reaching your file
or ... ?
Perhaps it might help if you could describe how would you would configure
this in a regular web.xml.

-Simon


"Jason Duley" <jason.duley@gmail.com> wrote in message
news:7206165.1168532937413.JavaMail.root@cp1.javalobby.org...
> Hi,
> I have a web application where I defined the following items in plugin.xml
....
>
> <extension point="org.eclipse.equinox.http.registry.servlets">
> <servlet alias="/ajax" class="org.foo.bar.MyServlet"/>
> </extension>
>
> <!-- html pages -->
> <extension
> point="org.eclipse.equinox.http.registry.resources">
> <resource alias="/" base-name="/web_files"/>
> </extension>
>
> given these two items, I want to configure the app such that a request to
the html page:
>
> "http://myserver.org/html_files/myhtml.html"
>
> will first be intercepted by the servlet (defined by /ajax). What is the
best way to accomplish this in the equinox framework?
> Thanks.
> Jason
Re: Servlet Mapping in Equinox Webapp [message #80871 is a reply to message #80781] Fri, 12 January 2007 18:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jason.duley.gmail.com

------=_Part_4263_27275313.1168625128184
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Simon,
Thanks for your help. I am trying to intercept calls to the items I defined in the plugin.xml file using a Filter.
Jason
------=_Part_4263_27275313.1168625128184
Content-Type: application/octet-stream; name=web.xml
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>LoginFilter</filter-name>
<filter-class>org.foo.bar.LoginFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

<servlet>
<display-name>MyServlet</display-name>
<servlet-name>MyServlet</servlet-name>
<servlet-class>org.foo.bar.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/ajax</url-pattern>
</servlet-mapping>
</web-app>

------=_Part_4263_27275313.1168625128184--
Re: Servlet Mapping in Equinox Webapp [message #80896 is a reply to message #80871] Fri, 12 January 2007 19:36 Go to previous message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 22
Registered: July 2009
Junior Member
At least in the current incarnation, the OSGi HttpService does not formally
support ServletFilters and subsequently neither does http.registry.
That said, from your web.xml I see you're using a LoginFilter. The
HttpContext object supports a handleSecurity method that might be worth a
look as you could write a custom HttpContext.
There's also a bug open to look at ServletFilters here ...
https://bugs.eclipse.org/bugs/show_bug.cgi?id=128068

-Simon




"Jason Duley" <jason.duley@gmail.com> wrote in message
news:31798967.1168625128200.JavaMail.root@cp1.javalobby.org...
> Simon,
> Thanks for your help. I am trying to intercept calls to the items I
> defined in the plugin.xml file using a Filter.
> Jason
Previous Topic:config plugins directory location used by org.eclipse.update.configurator
Next Topic:Available protocols for URL/URLConnections?
Goto Forum:
  


Current Time: Sun Jun 30 10:12:57 GMT 2024

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

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

Back to the top