In Java Web development, there are many common problems that developers will definitely encounter during the development process and need to be dealt with:
1. Garbled code problem
Why does the garbled code problem occur? Since there is a garbled code problem, it must be caused by inconsistent encoding settings. In the process of Web development, the following encoding settings are involved, encoding settings of client parameters, encoding settings of Web server, encoding settings of server-side applications, encoding settings of database, etc. As long as the encoding settings in these four places are different, garbled characters may occur. Before developing, developers should first understand where these four codes are set and what their current project settings are, so that coding problems can be avoided.
2. Permission control
For a Java Web system, not all pages and functions are allowed to be accessed by all users, so it is necessary to control which pages users can access. General Java Web systems require permission control. There are many ways to control permissions. In the past, I saw many projects writing permission control codes directly in the program. The disadvantages of this are obvious and are not conducive to expansion. As long as there are any modifications, considerable code needs to be modified. , firstly, it is prone to errors, and secondly, modifications are costly. A better idea is to use interceptors for permission control based on the idea of AOP. Of course, the premise is that the system must be configured with a certain database structure, such as a table structure such as user-role-permission table. Of course, there are currently many open source frameworks for permission control such as acegi
3. Parameter verification
All Input Is Evil. Verification of input parameters is indispensable. For parameter verification, there are client-side verification and server-side verification. Generally speaking, if verification can be performed on the client, client-side verification is given priority to reduce server-side pressure. There are many Javascript frameworks that can do this job very well. Such as Jquery Validation plug-in.
4. Exception handling
It should be said that exception handling is very important for every system. But in a B/S structure environment, exceptions are even more important. A well-designed exception handling framework can reduce a lot of code writing work.
5. Parameter passing
In the B/S structure, communication is completed based on HTTP. Every interaction between the client and the server is a process of parameter transfer. It is very important to control the passing process of parameters. It is necessary to clearly know which parameters need to be passed for each B/S interaction, which parameters are legal and which parameters are illegal, whether through GET, POST, or URL link.
6.Ajax
Today's Java Web system is impossible without using Ajax technology. Ajax is really a good technology. It can complete the communication with the server without refreshing the page. It makes the structure based on B/S more powerful. Many functions that cannot be completed by traditional Web applications can now be completed using B/S. architecture to achieve. There are many mature Javascript frameworks available for Ajax. The first recommendation is jQuery, which provides simple and practical Ajax functions.
7. Client-side Javascript technology
There are many client-side technologies, and Javascript should be said to be the most powerful and widely used one. Make good use of Javascript and consider the client-side implementation when designing the system, which can be a good assist in the functional design of the server-side. As an excellent Javascript framework, jQuery is still recommended. Its functions are simple, practical and powerful.