[jetty-user] Dispatching to a serlet based on URL patterns
Frazer Irving <[email protected]> Sat, 31 Dec 2011 09:46:42 +0000
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Message-ID | <CANprY6NUvcK2TmEfFhnzmnNEwykC0G-y2eN7+4Snkr_19Qq14g@mail.gmail.com> |
Hi,
I am interested in dispatching to a different servlet, or method within a
servlet, based on url patterns. Right now I am using
context.addServlet(new ServletHolder(new
SongServlet()),"/song");
But I am interested in implementing a RESTful API, so I am interested in
GET /song being dispatched to a method to retrive a listing of songs
POST /song being dispatched to a method to create a song
GET /song/{id} being dispatched to a method to retrive a specific song,
identified by {id}
I've seen this done quite gracefully by the Spring RequestMapping
annotation before. Is there something similar in the Jetty suite?
f