AD

A Java variable naming and code on the differences in Generation

1 Scenario Description:

- The service uses thrift, automatically generate java code!

- WEB program uses spring, ibatis, etc., in the JSP page with JSTL tags.

2 problems:

One day, the page with $ {payment.tBegin} access time field, life and death are the exception, saying that no payment object tBegin properties!

After careful examination, nothing abnormal; variable name entirely correct, get set the right way; in the controller where you can access to the tBegin properties!

3 found someone to watch, not see it!

Day, again from a pondering, found a difference: payment of all the property field, tBegin a little different - it's the second letter is capitalized! --- Do not look down upon this difference, then the problem is solved from here. . .

4 Finally one day, we began to suspect that tBegin capital before the second induced problem! Immediately wrote a class to test, found that:

- Eclipse code generation, and jstl advocate: If a property name of the second letter is capitalized, then get set method is generated, to retain the first letter lowercase, that gettBegin (), settBegin ()

- Thrift thrift java *. thrift at the time, for similar tBegin such, direct students to become getTBegin (), setTBegin ()!

! ! ! Khan, Khan waterfall! ! !
标签: java code, eclipse, variable name, access time, jsp, code generation, web program, code web, waterfall, life and death, scenario description, advocate, time field, jstl tags, careful examination
分类: Java
时间: 2011-05-06

相关文章

  1. java variable naming rules

    1. Case sensitive, for example, a and A are the two variables 2. The length of any 3. You can start any letter ...
  2. Java project naming convention transfer order

    Investigation of the Java project naming convention sun online documentation help documentation. Transfer from ...
  3. Java variable argument list, generic methods and generic in extends, super,? And other rules

    Another blog image Java variable argument list, generic methods and generic in extends, super,? Other rules Va ...
  4. Python and Java, variable parameters

    Accustomed to the strict Java syntax, when the first contact with Python, a very amazing feeling: by, the orig ...
  5. Ubuntu9.04 in the Java environment, build and code configuration

    Case in ubuntu9.04 First, enter the following command in the terminal, the role is to provide the required pro ...
  6. JAVA Class naming convention

    1. Entity Layer: Inheritance: All categories inherited from BasicEntity, one of BasicEntity implementation jav ...
  7. Java 7: New features. Code sample and performance testing

    http://java.csdn.net/a/20100420/263956.html If the Java development platform this year, there is a big thing, ...
  8. java project lines of code to achieve a simple calculation

    package com.burning.BurningUtil.util; import java.io.BufferedReader; import java.io.File; import java.io.FileR ...
  9. java variable type and can not change class

    1: Variable class and can not change classes (Mutable and Immutable Objects) preliminary definition: Variable ...
  10. A fast hardware issue here, ha ha JAVA/AS3/C # managed language and C + + / C code to explain differences

    Declare a int type of i = 0 i = i + +; Print i C + + / C which output 1 as3/java/c # which output 0 Why??? Hee ...
  11. JAVA static block, non-static code block, constructor, main method of execution order

    package java.oop; public class Customer extends Person{ static Name name = new Name("Tom"); static{ ...
  12. Java how to do code reuse

    First class written in a public database connection and close methods: public static Connection getConnection( ...
  13. JAVA development process, programming code on how to avoid performance problems caused by?

    In the program development process how to write code to avoid performance problems, J2EE development projects ...
  14. java Jar extract the code compression

    package com.mjp.upgrade.util; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import ...
  15. A problem caused by careless use of variable type: TC code

    var value=new Array(1024,768,250,480,540,800,600,933,700); for(var i in value) { Log.Message((1+i)<5?(i):(i ...
  16. JDBC Java database connectivity test code SQLServer2000

    import java.sql .*; public class JDBC { public static void main (String [] args) { String driverName = "c ...
  17. NO_DATA_FOUND and | | variable assembly and code examples for loop

    BEGIN BEGIN SELECT MC_XZQH INTO RESULT FROM DM_XZQH WHERE DM_XZQH = V_DM_XZQH; EXCEPTION WHEN NO_DATA_FOUND TH ...
  18. Eclipse Java代码折叠插件 Code Folding

    提供一个插件下载地址,博客园的: http://files.cnblogs.com/wucg/com.cb.eclipse.folding_1.0.6.jar.zip 添加插件到Myeclipse就不说了,百度吧 其他配 ...
  19. Bean in the spring configuration file, the difference between the id and name

    In the BeanFactory configuration, <bean> is our most common configuration items, it has two of the most ...