Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

0.4 MODEL and BEAN Note


May 14, 2021 JFinal manual



  • The data in the JSP template output bean will depend on its getter method, and the variable name of the output is the getter method that removes the "get" prefix character after the remaining character initials are lowercase, and if you want the JSP to still use the previous output, call ModelRecordElResolver when the system starts. setResolveBeanAsModel(true);
  • GetModel() in Controller requires the form domain name to correspond to the data sheet field name, while getBean() relies on the setter method, which corresponds to the lowercase of the string letters left after the setter method removes the "set" prefix character.
  • Many third-party tools like jackson and fastjson rely on bean's getter method to operate, so jackson and fastjson can only be used after the fit
  • When JFinalJson converts Model to json data, json's keyName is the original data table field name, while the keyName of json, which relies on the getter method to convert, is the hump name for the data sheet field name
  • It is recommended that the field names of the mysql data table be named directly with humps, which would make json's keyName exactly the same, or that JSP use exactly the same property names when taking values on the page. Note: The name of the mysql data table still makes it easy to port between linux and windows systems by underlining and using lowercase letters.
  • In summary, the combined bean should be used clearly using the getter, setter method in its BaseModel, or the get attName method in its Model