September 18, 2009
Poll Result: Java Is Most Preeminent in Europe.
Some voters in this past week's java.net poll questioned whether the question could be answered, but the result showed that a plurality of voters considered Europe to be region where Java has the greatest market share among competing technologi...
More »
September 17, 2009
Sun Collaborates with Software Freedom International to Connect More than 25,000 Developers and Students in 30 Countries for Software Freedom Day 2009. Building on its commitment to empower developers and students across the globe, Sun Microsystems, Inc. (NASDAQ: JAVA) is sponsoring more than 300 community style events in more than 30 countries for Software Freedom Day (SFD) on September 19, 2009. W...
More »
November/2009
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | | 8 | 9 | 10 | 11 | 12 | 13 | 14 | | 15 | 16 | 17 | 18 | 19 | 20 |
21 | | 22 | 23 | 24 | 25 | 26 | 27 | 28 | | 29 | 30 | | | | | |
|
 |
URL patterns are more flexible in Jersey than in the web.xml
Rule of thumb: Avoid to use {variables} as the first path of a
Jersey's @Path
I am working on the Arena PUJ Project, a RESTful web-service to
support PUJ competitions. We are in the early stages of the project but
we already got some resources published on the web. Let me show you a
few URL samples:
An insecure GET method to read all competitions promoted by a
JUG:
GET /{competition_id}/homework
Sample URL: http://fgaucho.dyndns.org:8080/arena-http/institution/cejug/competition
curl -v -H "Accept: application/json" -XGET
http://fgaucho.dyndns.org:8080/arena-http/institution/cejug/competition
An insecure GET method to read all homeworks from a competition
name:
GET /{competition_id}/homework
Sample URL: http://fgaucho.dyndns.org:8080/arena-http/PUJCE-08/homework
curl -v -H "Accept: application/json" -XGET
http://fgaucho.dyndns.org:8080/arena-http/PUJCE-08/homework
A secure method for creating a new homework. In the PUJ business
model, only professors can submit a homework.
POST /{competition_id}/homework/{homework_id}
Sample URL:
http://fgaucho.dyndns.org:8080/arena-http/PUJCE-08/homework/newHomework
curl -v -H "Accept: application/json" -XPOST
http://fgaucho.dyndns.org:8080/arena-http/PUJCE-08/homework/newHomework
The problem: you cannot map variables in the beggining of the
path in the web.xml
In Jersey, all the above URLs are valid, actually Jersey can also
use regular expressions to map...
Date: September, 17 2009
Url: http://www.java.net/blog/felipegaucho/archive/2009/09/17/url-patterns-are-more-flexible-jersey-webxml
Others News
Leave a Reply
Related
- Simple Flex Webapp ... form</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>spring-flex</servlet-name> <url-pattern ...
|