Another injection method of spring is to inject through the JavaBean constructor. It differs from setting value injection in that constructor-Arg must be used as the tag in the configuration file, while setting value injection uses the property. In addition, you need to add the parameter constructor In the caller's implementation class. The called user is used as the construction parameter.
Advantages and disadvantages:
To be supplemented ......
Construction injection may affect performance. Therefore, constructor injection is not applicable to recommendations with complex dependencies. Constructor injection is recommended for fixed dependencies. Value-based injection, supplemented by construction injection.
Ajax today understands prototype when a component is used. When will Ajax be used? 1. If you do not want the information you entered to exit your implementation, you may need to fill in all the information you entered after the original submission, resulting in inconvenience in use. 2. You only need to submit some content, for example, many parts of the entire page, including a login window. You only need to submit the login information. If all the information is submitted, the page will be rerefreshed, affecting the speed.
It is worth noting that AJAX depends on the operating system encoding. The operating system in China is generally gb2312. Therefore, remember to transcode the submitted content,
Use for receiving:
String name = new string (request. getparameter ("name"). getbytes ("ISO-8859-1"), "gb2312 ");
Use the following command to return data:
Response. setcharacterencoding ("gb2312 ");
Response. getoutputstream (). println (result );
Response. flushbuffer ();
To prevent Chinese garbled characters.