1SPRINGMVC Working principle
2 What is the role of AOP,AOP?
3 How to optimize hibernate
4 explaining the automatic assembly of spring in different ways
5 Why is it important to provide a parameterless constructor in a hibernate entity class?
6 What does Java Web-related middleware have
7 with struts, why does MVC need spring's MVC
8 Which of the following statements is correct ()
A instance method can call directly to an instance of a superclass method B instance method can call the class method of the superclass directly C instance method can call the instance method of other class directly the D instance method can call the class method of this class directly
9 What are the singleton patterns, write a singleton out
What are the 7 modules of a 10spring frame?
1
1, the client sends an HTTP request to the Web server, the Web server resolves the HTTP request, and if it matches the Dispatcherservlet request mapping path (specified in Web. xml), the Web container forwards the request To Dispatcherservlet.
2. After receiving this request, Dipatcherservlet will find the processor (Handler) processing the request based on the requested information (including URL, HTTP method, request packet header and request parameter cookie, etc.) and handlermapping configuration.
3-4, Dispatcherservlet according to handlermapping find corresponding handler, the processing right to handler (handler will be specific processing to package), Then the specific handleradapter to the handler to make a specific call.
5, Handler will return a Modelandview () object to Dispatcherservlet after the data processing is completed.
6. Handler return Modelandview () just a logical view is not a formal view, Dispatchersevlet transforms a logical view into a real views view by Viewresolver.
7, dispatcher through the model to parse out the parameters in the Modelandview () and finally show the full view and return to the client.
2AOP is the continuation of OOP and is the abbreviation for (Aspect oriented programming), meaning aspect-oriented programming.
3 1. Use bidirectional one-to-many associations, do not use unidirectional-to-more 2. Flexible use of one-way-to-multiple associations 3. Do not use one-to-many instead of 4. Configure the object cache without using the collection cache
5. One-to-many collection using bag, set 6 for many-to-many collections. Inheriting classes use explicit Polymorphism 7. Table fields are less, tables associated not afraid of more, there are two levels of cache backing
4 1:no The default way is not to assemble automatically, by manually setting the Ref property to assemble the bean
2:byname is automatically assembled by the name of the parameter and automatically assembled if the name of a bean is the same as the property of another bean.
3:bytype automatically assembled by the data type of the parameter, if the data type of one bean is compatible with the data type of another Bean's property, it is automatically assembled
The parameters in the 4:construct construction method are automatically assembled in the form of Bytype.
5:autodetect If there is a default construction method, it is automatically assembled by means of construct, otherwise it is automatically assembled using the Bytype method.
5 to generate an instance of a class, hibernate does not need to know what parameters and attributes you have inside, so it is easiest to construct it with no arguments.
6 Tomcat, WebSphere, WebLogic, JBoss, and so on are Web middleware, Web servers
7 1. Mechanism. The entrance to Spring MVC is the servlet, and struts is the filter (it is noted here that the filter and servlet are different.) 2. Performance. Spring will be a little faster than struts.
Spring MVC is a method-based design, and Sturts is class-based, each time a request is made to instantiate an action, each action is injected into a property, and spring is based on the method
, finer granularity, but be careful to control the data like in the servlet. 3. Parameter passing. Struts is used to accept parameters when parameters are accepted, which means that the parameter
Number is shared by multiple methods. 4. Design ideas. Struts is more consistent with OOP programming ideas, and spring is more cautious, extending on Servlets, 5.intercepter implementations
Mechanism. Struts has its own interceptor mechanism, and spring MVC uses an independent AOP approach. This causes struts to have a larger profile than spring MVC,
While the struts configuration can be inherited, I think the use of spring MVC is more concise.
8 D.
9 A Hungry man type class Singleton {lazy type
private static Singleton instance=new Singleton ();
Private Singleton () {}
Static Singleton getinstance () {
return instance;
}
Ten Core AOP DAO ORM WEB MVC Context
3-23 (few days left)