Analysis on Spring surface test questions

Source: Internet
Author: User

  • What technology does spring use primarily in development?
    • IOC container manages the components of each layer
    • Configuring declarative Transactions with AOP
    • Integrate other frameworks.?
  • Brief introduction to AOP and IOC concepts
    • ? Aop:aspect oriented program, programming for (aspect) facets; Filter (filters) is also an AOP. AOP is a new methodology that complements traditional OOP (object-oriented programming, object-oriented programming). The main programming objects of AOP are facets (aspect), while facets are modular crosscutting concerns. You can use the transaction description as an example.
    • Ioc:invert of control, inversion of controls. Also become Di (dependency injection) whose idea is to reverse the direction of resource acquisition. The traditional resource lookup method requires that the component initiate a request lookup resource to the container. In response, the container returns resources in a timely manner. When the IOC is applied, it is the container that proactively pushes the resources to the components it manages, and what the component does is to choose an appropriate way to accept resources. This behavior is also known as the passive form of lookup.
  • how do I configure the Bean in spring?

    bean is configured by means of a full class name (reflection), through the factory method (static factory method & Instance factory method), Factorybean.

  • IOC container-to-bean lifecycle:?
    • set values for bean properties and references to other beans.
    • bean can be used.
    • ?.
  • how Spring integrates Struts2?

    integrated Struts2, Struts2 Action:

    • Install the Spring plugin: Copy the Struts2-spring-plugin-2.2.1.jar to the current Web application's Web-inf/lib directory.
    • Configures the action in the struts configuration file, but its Class property no longer points to the implementation class of the action, but instead points to the The ID of the action instance in the Spring container.
  • how Spring integrates Hibernate

    • use Localse Ssionfactorybean Factory Bean, declares a sessionfactory instance that uses an XML mapping file.
    • use Hibernatetransactionmanager to configure Hibernate's transaction manager?.
  • Spring MVC comparison Struts2?
    • The entry for Spring MVC is the servlet, and Struts2 is the filter.
    • Spring MVC will be slightly faster than Struts2. Spring MVC is based on method design, and Sturts2 is class-based, and each time a request is made, an action is instantiated.
    • Spring MVC is more concise and development efficient spring MVC is indeed higher than struts2: support for JSR303, more convenient for processing AJAX requests.
    • Struts2 's OGNL expression makes page development more efficient than spring MVC. ?
  • How is Spring MVC running?
    • Throughout the Spring MVC framework, Dispatcherservlet is at the heart of the work of coordinating and organizing different components to complete request processing and return responses.
    • SPRINGMVC processing request process:
      • If a request matches the Dispatcherservlet request mapping path (specified in Web. xml), the Web container will forward the request to dispatcherservlet processing.
      • dispatcherservlet receives the request based on the requested information (including URL, HTTP method, request header, request parameters, cookie, etc.) And the handlermapping configuration to find the processor that processed the request (Handler). Handlermapping can be regarded as a routing controller, handler as the target host.
      • when Dispatcherservlet according to handlermapping get handler corresponding to the current request, The handler is encapsulated by Handleradapter and then called Handler with a unified adapter interface.
      • When the processor finishes processing the business logic, it returns a Modelandview to Dispatcherservlet, Modelandview contains the view logical name and model data information.
      • dispatcherservlet the resolution of the logical view name to the real view object with Viewresoler.
  • Say 5 notes commonly used by spring MVC:?

    @RequestMapping, @PathVariable, @RequestParam, @RequestBoy, @ResponseBody?

  • How do I complete a JSON operation using spring MVC:?
    • Configure Mappingjacksonhttpmessageconverter.
    • Use @requestbody annotations or responseentity as the return value.

Analysis on Spring surface test questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.