| Article: |
The REST of the Web | |
| Subject: | Shouldn't you be creating new URIs? | |
| Date: | 2005-05-06 14:52:30 | |
| From: | lordpixel | |
|
I'm not the world's greatest REST expert, but what struck me about your article is that creating new items doesn't create new URIs, which seems to be the usual idiom in RESTful systems.
|
||
Showing messages 1 through 5 of 5.
-
Shouldn't you be creating new URIs?
2005-05-06 18:43:09 jrbriggs [View]
-
Shouldn't you be creating new URIs?
2005-05-08 12:32:12 nferrier [View]
"I don't think the servlet mapping will pick up test5.py as the correct servlet to call."
Errr... no. Just make sure the servlet mapping has a pattern that looks like:
<url-pattern>/test5.py/*</url-pattern>
-
Shouldn't you be creating new URIs?
2005-05-08 18:23:57 jrbriggs [View]
Ack! You're right. But adding the python servlet as a mapping in web.xml does remove a bit of the flexibility (albeit not much) from the whole system.
I had a play with the source code of PyServlet last night, and it's relatively simple to modify so that it will look for the last reference to a ".py" file in the path and then ignore what comes after. Which would allow you to have a catchall url-pattern and not prespecify py servlets. -
Shouldn't you be creating new URIs?
2005-05-09 02:50:09 nferrier [View]
According to cool-uris-don't-change you shouldn't expose the .py anyway. URIs should be logical and not implementation dependant. -
Shouldn't you be creating new URIs?
2005-05-12 05:48:17 r.p.wilson [View]
Aren't you nitpicking? And I think you've missed the point.



In any case, the main problem with providing for a proper URI (for example, something like /test5.py/XXXXX) as my example stands, is that I don't think the servlet mapping will pick up test5.py as the correct servlet to call. You probably end up with a Not Found error (I'm on holiday at the moment, so it's a bit hard to check). To create a stricter version, I believe subclassing PyServlet will be required in order to provide for the slightly more complicated uri structure. Unless someone else has a better idea of course.