click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r1327792 - /click/trunk/click/extras/src/org/apache/click/extras/spring/SpringClickServlet.java
Date Thu, 19 Apr 2012 02:47:50 GMT
Author: takezoe
Date: Thu Apr 19 02:47:49 2012
New Revision: 1327792

URL: http://svn.apache.org/viewvc?rev=1327792&view=rev
Log:
[CLK-789]SpringClickServlet#toBeanName() use Introspector#decapitalize() to generate the Spring
bean name from the page class name.

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/spring/SpringClickServlet.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/spring/SpringClickServlet.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/spring/SpringClickServlet.java?rev=1327792&r1=1327791&r2=1327792&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/spring/SpringClickServlet.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/spring/SpringClickServlet.java Thu
Apr 19 02:47:49 2012
@@ -18,6 +18,7 @@
  */
 package org.apache.click.extras.spring;
 
+import java.beans.Introspector;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -34,7 +35,6 @@ import javax.servlet.http.HttpServletReq
 import org.apache.click.ClickServlet;
 import org.apache.click.Page;
 import org.apache.click.util.HtmlStringBuffer;
-
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -518,9 +518,7 @@ public class SpringClickServlet extends 
      * @return the class bean name
      */
     protected String toBeanName(Class<?> aClass) {
-        String className = aClass.getName();
-        String beanName = className.substring(className.lastIndexOf(".") + 1);
-        return Character.toLowerCase(beanName.charAt(0)) + beanName.substring(1);
+        return Introspector.decapitalize(aClass.getSimpleName());
     }
 
     // Package Private Inner Classes ------------------------------------------



Mime
View raw message