You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2007/03/02 18:14:19 UTC
svn commit: r513848 -
/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java
Author: imario
Date: Fri Mar 2 09:14:18 2007
New Revision: 513848
URL: http://svn.apache.org/viewvc?view=rev&rev=513848
Log:
changed naming strategy, always make the first letter lower-case
Modified:
myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java
Modified: myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java
URL: http://svn.apache.org/viewvc/myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java?view=diff&rev=513848&r1=513847&r2=513848
==============================================================================
--- myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java (original)
+++ myfaces/fusion/trunk/core/src/main/java/org/apache/myfaces/fusion/viewController/DefaultViewControllerNameMapper.java Fri Mar 2 09:14:18 2007
@@ -30,7 +30,7 @@
* The strategy of this mapper is as follows:
* <ul>
* <li>slash ('/') will be removed</li>
- * <li>every character after a slash will be convertert to uppercase</li>
+ * <li>every character after a slash will be convertert to uppercase, except the first char</li>
* <li>everyting after a dot ('.') will be removed</li>
* <li>reserved words {@link #RESERVED_WORDS} are prefixed with an underscore ('_')</li>
* <li>result starting with an digit are prefixed too </li>
@@ -41,8 +41,8 @@
* <table border="1">
* <thead><tr><th>ViewId</th><th>BeanName</th></tr></thead>
* <tbody>
- * <tr><td>/userInfo.jsp</td><td>UserInfo</td></tr>
- * <tr><td>/secureArea/userPassword.jsp</td><td>SecureAreaUserPassword</td></tr>
+ * <tr><td>/userInfo.jsp</td><td>userInfo</td></tr>
+ * <tr><td>/SecureArea/userPassword.jsp</td><td>secureAreaUserPassword</td></tr>
* </tbody>
* </table>
* </p>
@@ -99,6 +99,11 @@
sb.setCharAt(i, Character.toUpperCase(c));
nextUpper = false;
}
+ }
+
+ if (sb.length() > 0)
+ {
+ sb.setCharAt(0, Character.toLowerCase(sb.charAt(0)));
}
String beanName = sb.toString();