Spring share some classic face questions for reference study.
1. Spring's Ioc and aop what principle are implemented?
The main application of the java reflection technology
2. Spring mechanism and Why?
1) spring mvc Please submit all requests to DispatcherServlet, it will delegate the other modules of the application system is responsible is responsible for processing requests real.
2) DispatcherServlet query one or more HandlerMapping, found handling the request Controller.
3) DispatcherServlet please submit a request to the target Controller
4) Controller for business logic processing, returns a ModelAndView
5) Dispathcher query one or more ViewResolver view resolver, find ModelAndView specified object view object
6) view object responsible for rendering back to the client
AOP allows developers to create non-behavioral concerns, called crosscutting concerns, and insert them into the application code. After using the AOP, public services (such as logging, persistence, transactions, etc.) can be decomposed into context and apply it to domain objects without increasing the complexity of the object model of the domain object.
IOC allows you to create a target application environment can be constructed, and then pass them collaborators to these objects. As indicated by the word upside down, IOC came as anti-JNDI. Do not use a bunch of abstract factories, service locator, single element (singleton) and direct configuration (straight construction), each object is constructed with its collaborators. So it is managed by the container collaborators (collaborator).
Even a Spring AOP framework, is also an IOC container. Spring is the best place it can help you replace the object. With Spring, as long as JavaBean properties and configuration files added dependencies (collaborators). Then it can be easily replaced when needed collaborators have similar interfaces.
3. How to internationalize?
International: do not modify the code, it applies to countries in different languages
Localization: If you want to adapt to a country, you want to modify the source code
struts-configxml with the following label instructions in the resource file name, just pay attention to the file name, not the national language _
In the resource file by adding the corresponding directory struts adapted to different languages, country properties file
If it is not English be transcoded
native2ascii -encoding gb2312 source ApplicationResources_zh_Cproperties
used in jsp page
4.Spring the BeanFactory and ApplicationContext difference?
ApplicationContext and BeanFacotry compared to provide more extension, but the main difference is that the latter is lazy loading, if one does not attribute Bean injected after BeanFacotry loaded until the first time you use the call method will throw getBean exception; while the ApplicationContext itself in the initialization test, which will help check whether the dependency property injection; so we usually choose to use ApplicationContext.
5. Tell me what you develop with ssh framework of understanding?
Framework: hibernate, spring, struts;
Hibernate is mainly used for data persistence;
Spring's inversion of control can play the role of decoupling;
Struts is mainly used for process control.
6. Please explain what is MVC? (Design pattern)
A) M ---- Model encapsulate business data and business operations.
B) V ----- View encapsulates the user interface.
C) C ----- Controller encapsulate business processes.
7. MVC various parts of what are the techniques to achieve? How?
The presentation layer struts
Persistence layer hibernate
Control layer spring
Is the most commonly used development framework ssh
8. Adoption of the map, talk about your understanding of the MVC model. (Enterprises are likely to enable students to draw)?
1) The first is to show a view to a user, the user operates on this view, and to fill in some business data
2) The user then click the submit button to request
3) View user requests sent will arrive controller included in the request what you want to accomplish business functions and related data.
4) controller to handle user requests, will request data encapsulation, and then select and call the appropriate model, model request status updates, and then select the next step is to show to the user's view.
5) model will be to handle business functions requested by the user, as well as the model state of maintenance and updating
6) When the model status changes, the model will notify the appropriate view, telling view its status changed.
7) view, by notice to the model, the model will be the status query to obtain data required to show, and then follow the presentation view itself, the data displayed.
8) The next step is to wait for the next user operation from scratch once again reincarnation.