Things to keep in mind at work

  When you need to get data from the page and process it from the background. A judgment must be added to determine whether it is empty. Null pointer exceptions occur frequently.

  

  When writing a method in the background, try to add try catch to display the exception in the background without causing the page to report an error, thus affecting the customer experience.

  

  When you want to add multiple objects through the for loop, you must create a new object in the for loop, otherwise you can only save one, and that object will be updated all the time.

  

  When adding an object, if the page display page suddenly has a ",", it means that the added page has two fields with the same name attribute.

 

  When the js conflict, you can try to swap the position of the two js. If not, you can change one of the two conflicting methods.

  

  When updating objects in the background, sometimes it is necessary to set some fields separately. That is because sometimes the page does not display all the fields of the object for updating when updating. If the set setting is not performed in the background, it will default to Empty, resulting in data loss.

  

  SpringMVC+Hibernate framework, form form can submit all parameters within it.

  

  After getting the requirements, you must first analyze them to determine how to design and develop them. Otherwise, it will be a mess later on. Dare to question and speak up if you feel unreasonable. Dare to imagine.

  

  Be sure to have a good programming habit, even if it is copied, you must modify all the needs to be modified. The background method is annotated, and the entity class naming rules are also explained in the annotation as much as possible.

 

  The modification time and the update time must exist in the entity class. It is convenient to query after an error occurs.

 

  The paging page must be initialized in the page, otherwise it will not work.

 

  The public methods that can be extracted must be extracted, otherwise it will be very troublesome to modify later.

 

  The enumeration class should be used as it should be, and the use I found myself: in a public class, it is clear that a certain string or number represents a certain type, and when used in a background method, the enumeration of the public class can be called directly. When you want to know what the enum class represents. Entering the public class can be seen at a glance.

 

  When starting tomcat does not report an error, but it is stuck and no longer running, it is very likely that the database cannot be connected. You can test whether to connect to the database by pinging the database address or telnet database connection port.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325024981&siteId=291194637