| Author |
Tips to write friendly URLs
|
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3359
|
|
Hey,
I am trying to write a Friendly URLs by hand:
/servlet/2010/11/27
/servlet/year/2010/month/11/day/27
How to access request parameters this way?
I'm doing it right now via RegExp but is there a better way?
Thanks.
|
 |
dave hopkins
Greenhorn
Joined: Oct 27, 2006
Posts: 22
|
|
There's more to REST than just matching params dude. Forget code just for the minute and read up on the principles first.
Here's a really good article
http://www.peej.co.uk/articles/restfully-delicious.html
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56183
|
|
What you are describing is not RESTful, it's called "friendly URLs".
So what are you really asking? Do you want to create a RESTful web service? Or do you just want to be able to specify parameters in the URL rather than in a query string?
If the latter, you can grab the string using getPathInfo() and parsing it yourself.
P.S. The FrontMan 2 beta does this for you.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3359
|
|
Yes, I mean friendly URLs not RESTful, sorry I forgot about that.
Actually that is what I'm doing, parse the string of getPathInfo().
I will correct my post subject.
Thanks.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56183
|
|
|
Can you not just use String.split()?
|
 |
Hussein Baghdadi
clojure forum advocate
Bartender
Joined: Nov 08, 2003
Posts: 3359
|
|
Bear Bibeault wrote:Can you not just use String.split()?
Even better
Thanks.
|
 |
Jagdeep Sharma
Ranch Hand
Joined: May 24, 2010
Posts: 121
|
|
John Todd wrote:
Bear Bibeault wrote:Can you not just use String.split()?
Even better
Thanks.
Hey People,
I found myself very new to this topic. Can you people give some difference between RESTful urls and user friendly urls.
Thanks
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56183
|
|
|
REST
|
 |
 |
|
|
subject: Tips to write friendly URLs
|
|
|