The role of Java Web idea of each package put class description

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/u010835486/article/details/80730638

First, is divided into idea, out, src, web four large bags, mainly for src and web are two more important to explain

 

Divided into several packages 1. Objective: optimization of the code, to achieve a high polymerization, low-coupling characteristics, easy to expand later changes

2.src each role in package name:

  • bean is stored Javabean standard class. JavaBean in accordance with the type of function can be divided into visual and non-visual categories. Visual GUI JavaBean is to have a graphical user interface for end-users is visible. Does not require visual JavaBean inheritance, it is used more in the JSP, for usually encapsulate business logic , data paging logic , database operations , and business logic , etc., and thus separated foreground program service logic may be implemented to improve the the readability and maintainability of the code, making the system more robust and flexible. With the development of JSP, JavaBean more applications in non-visual field, and show in terms of server-side applications increasingly strong vitality.

  • dao storing data in the database is done based operations such as additions and deletions. DAO (DataAccessobjects data access objects) means for access to the persistent data is located between the business logic and data persistence. Popular terms, is to encapsulate database operations.

  • service is located on another type of packaging dao classes. Service layer called the service layer, called a service, a rough understanding is that once again the package to one or more DAO made, packaged as a service, so there will not be an atomic operation, the need to control things.

  • utils is used to store tools needed. For example, the tool connection pool class (as DataSourceUtils)

  • web store is inherited HttpServlet class. Java Servlet is a program running on the Web server or application server, it is used as an intermediate layer between the database or application server and HTTP requests from the Web browser or other HTTP clients. The use of Servlet, you can collect user input from a Web form, showing records from a database or other source, you can also create dynamic web pages. JavaServlet procedures typically using CGI (Common Gateway Interface, common gateway interface) can be implemented to achieve the same purpose.

3.web effect of each packet:

  • css css style file stored in the front end

  • fonts stored each operating system browser font file

  • js js script file storage

  • INF-WEB WEB-INF directory of Java is safety of WEB applications. The so-called security is the client can not access, only the directory server can access. If you want to access the files directly in the page must be mapped to the appropriate files to be accessed through the web.xml file access.

  • jsp file JSP (full name JavaServer Pages) by Sun Microsystems a dynamic web technology standards to create a leading company. JSP deployed on a network server, can respond to a request sent by the client, and dynamically generate content according to the request the HTML , the XML or other format documents Web pages, and then returned to the requestor. JSP technology to Java language as a scripting language to provide services to the user's request, and to other Java programs on servers together to handle complex business needs.

Guess you like

Origin blog.csdn.net/u010835486/article/details/80730638