I was originally using .htm in my application (just because the Spring tutorial I followed did!) but I moved to extension-less URLs and am so glad I did. /clients/edit/34 looks much better than clientEdit.htm?clientId=34 in my opinion. It also fits in really nicely with Springs annotated controllers which can use URI templates which automatically extracts the 34 to a clientId variable for you!
Originally Posted by lcmorley
The Spring PetClinic example (access using SVN at https://src.springframework.org/svn/...tclinic/trunk/) also uses extension-less URLs so I'd advise you to take a look at that but I'll try to give a very brief explanation here.
In web.xml you change the mapping from .htm to /app/*:
You also include a new filter that allows incoming URLs to be rewritten before they are processed by servlets:
N.B. I use Maven so I have included the following in pom.xml to get the UrlRewriteFilter in my project:
The UrlRewriteFilter needs a configuration file to tell it how to manipulate the URLs:
What this is basically saying is that incoming requests for /<something> will be routed to /app/<something>. The exception is for static resources which don't get routed under /app. So, static resources will be served by the container's default servlet which is very efficient.
<?xml version="1.0" encoding="UTF-8"?>
What I know about AJAX can be written on a postage stamp
As regards the AJAX stuff, that is my next obstacle, so may be posting questions about that next.