> From: Code for Libraries [mailto:[log in to unmask]] On Behalf Of
> Emily Lynema
> Sent: Thursday, July 03, 2008 12:22 AM
> To: [log in to unmask]
> Subject: [CODE4LIB] implementing cool uris in java
>
> I'm looking around for tools to implement cool uris in java. I've been
> studying the restlet framework tonight, and while it sounds cool, I
> think it would also require a complete re-write of an application that
> is currently based on the Servlet API. And, of course, I'm working
> under
> a time crunch.
>
> Is there anything out there to assist me in working with cool uris
> besides just using regular expressions when parsing URLs?
>
> For example, I'd like to create URLs like:
>
> http://catalog.lib.ncsu.edu/record/123456
>
> instead of:
>
> http://catalog.lib.ncsu.edu/record?id=1234565
There are a number of ways you can create them, but they depend upon your Web server and application infrastructure. For example, if you are using Apache for a Web server you can could use mod_rewrite or if you are using Tomcat for a Web server you could use URL rewrite. Since you mentioned that your application is using the Servlet API, you could write a Servlet interceptor or Servlet filter to process the request before it gets to your application. The easiest is to use mod_rewrite or URL rewrite. This is what we did for our Terminology Services project to hide those ugly SRU URL's.
Andy.
|