With Notes


1. When using the command window, if you have modified the configuration of the environment or modified anything, you need to reopen cmd, because the old command window uses the old PATH variable and will not be updated automatically. For example, when configuring mysql's bin to PATH, it was configured at that time, but cmd was opened before, so when you enter mysql -uroot -p123456, an error will be reported, showing that mysql is not a window command or the like.

2.

The <base> tag specifies the default address or default directory for all links on the page.

3. When deploying a project on myeclipse, pay attention to whether the tomcat that comes with myeclipse is selected during deployment or the tomcat that is installed by yourself. Open the corresponding tomcat server according to the tomcat you choose. Made a mistake here today. Click the project name, right-click, and run on server. It is Run As-->MyEclipse Server Application

4. The code of the layered architecture follows [domain model layer (domain), User.java] → [data access layer (dao, dao.impl), UserDao.java, UserDaoImpl.java] →[Business processing layer (service, service.impl), UserService.java, UserServiceImpl.java]→[Presentation layer (web.controller, web.UI, web.filter, web.listener), xxxServlet.java]→[Tools The function of the class (util) and the tool class is to encapsulate the form data submitted by the client into the formbean] → [test class (junit.test)].

In the usual project development, the development is also carried out in the following order:
  1. Build the development environment
    1.1 Create a web project
    1.2 Import the development package required by the project
    1.3 Create the package name of the program. In java, the package is used to reflect the hierarchical structure of the project.
  2. The development domain
  treats a table to be operated as a VO class (the VO class only defines attributes and the get and set methods corresponding to the attributes) , does not involve the operation method of the specific business), VO represents the value object, in layman's terms, is to treat each record in the table as an object, and each field in the table as an attribute of this object. Each time a record is inserted into the table, it is equivalent to inserting a VO class instance object into the data table. When operating the data table, a VO class object is directly written into the table, a VO class object. Just a record. Each VO object can represent a row of records in a table, and the name of the VO class should be the same as or correspond to the name of the table.
  3. Develop dao
    3.1 DAO operation interface: Each DAO operation interface specifies the specific operation method of a table in a project. The name of this interface is best written in the following format: "I table name Dao".
      ├All the methods in the DAO interface are written according to the following names
        : ├Update the database: doXxx() ├Query the
        database: findXxx() or getXxx()
    3.2 The implementation class of the DAO operation interface: complete the specific addition, deletion, modification, and query operations in the implementation
      class├ This implementation class only completes the core operations in the database, and does not specifically handle the opening and closing of the database, because these operations have nothing to do with specific business operations.
  4. Develop service (service provides all business services to the web layer)
  5. Develop web layer

5. All jsp pages located in the WEB-INF directory cannot be accessed directly through the URL address. During development, if there are some sensitive web resources in the project that do not want to be directly accessed by the outside world, you can consider placing these sensitive web resources in the WEB-INF directory, so that the outside world can be prohibited from accessing directly through the URL.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326822693&siteId=291194637