On 1/16/09, Felix Meschberger <[email protected]> wrote: > Hi all, > > Prompted by Shane Johnson's comments on the naming conventions for > servlets in the repository [1], I come to think, that there might be > another solution or way to look at it. > > Currently a script must basically be named according to the following > convention: > > [ selector "." ] method | > [ selector "." ] extension | // GET only > selector // GET html only > > All matches are done case-sensitive. This works find with general > scripts, which may have as many dots in the file name as we like. For > Servlets (stored in the repository) it is more problematic, since class > files must be named after ther class name and class names are not > allowed to have dots in it. > > To workaround this, I could imagine, that we extend the convention for > script file names: > > [ selector "." ] method | > Selector method | > [ selector "." ] extension | // GET only > Selector Extension | // GET only > selector | // GET html only > Selector // GET html only > > (uppercase signifies camelcased name). > > So the request "GET /some/path.print.html" could be handled by any of > the following scripts > > path.GET.jsp > GET.jsp > PathGET.java > path.html.esp > html.esp > PathHtml.vlt > path.gsp > Path.groovy > > This would of course extend the list of checks to apply for finding > scripts, but would certainly gelp Java developers. > > The drawback of this is, that the request "GET /path.PrintA4.html" might > be handled by the same script as "GET /path.Print.A4.html". But this may > be a hypothetical collision and problem. > > WDYT ? i like this idea. with the scripted servlets, you get the "power" of servlets, and the ease-of-use for deployment and development as with jsps. until now, the only draw back is that the class and package names mess up the IDE. so this solution is great.
regards, toby
