On 11/14/05, Rahul Akolkar <[EMAIL PROTECTED]> wrote: > > On 11/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Author: craigmcc > > Date: Mon Nov 14 17:53:40 2005 > > New Revision: 344288 > > > > URL: http://svn.apache.org/viewcvs?rev=344288&view=rev > > Log: > > [37477] Prefix directory names starting with a digit > > > <snip/> > > viewId = viewId.replace('/', '$'); > > if (reserved.contains(viewId)) { > > + return "_" + viewId; > > + } else if ((viewId.length() > 0) && Character.isDigit(viewId.charAt(0))) > { > > return "_" + viewId; > <snap/> > > Craig, > > I had thought of something else, and the first part of the compound > condition above brought it back to me. > > The DefaultViewControllerMapper algorithm is beautiful in its > simplicity, but also imposes a few restrictions on the naming of > views. I understand that the ViewControllerMapper can be easily > replaced, but I suspect many of us will be using the default impl. > > Best practices such as: > * Not having a view placed at context root with just digits in the > filename
Doesn't that use case get covered by the patch we just committed? If the input path is "/123.jsp", then this will now get translated to "_123" instead of "123" like it used to. * Not having a hyphen in the filename > might serve as a nice heads-up. A more general description of the restriction (with this as an example) is that the resulting view identifier needs to be a valid identifier, as defined by the syntax of the expression language. I can draft a patch for Javadoc, is > that where you'd post those? Yes, I think the class Javadocs for DVCM is the right place for such information (since the restrictions are based on the algorithm embedded in this particular class). Please feel free to draft a patch so that we can cover this kind of thing. -Rahul Craig