SPRINGMVC Environment Construction

Source: Internet
Author: User

MyBatis Framework---Persistence layer Framework-->object "objects" relation[relational database]mapping[in MyBatis which mapping file China <resultMap> tags] Framework For the encapsulation of JDBC, a custom SQL statement is required. Dealing with dataaccessobjecT data Access objects

Springmvc It's part of the spring framework, it's just a small module in the Big Spring Framework, and SPRINGMVC is replacing the servlet we learned before.

How do you learn a framework first?

1. Find Jar

2. Configure the core configuration file

3. Read the core configuration file

4. Test Hello World

Read Core profile : MyBatis, it is up to us to read the Mybatis-config.xml Java

SPRINGMVC framework, Web layer, Dynamic Web project

Step one: Find jar[19]

Step two : Set up the core configuration file

The Dispatcherservlet is a actual Servlet (it inherits from the HttpServlet base class), and as such are declared in the c0>web.xml[ Deployment descriptor ] of your Web application. You need to map requests so want the dispatcherservlet to handle, by using a URL of mapping in the same Web. xml file. This is the standard Java EE Servlet configuration; The following example shows such a dispatcherservlet declaration and mapping:

The life cycle of the servlet

Send Request --If you are the first access to get initialization using the server init () method instantiation

--"service method", Judge with Doget, Dopost

<load-on-startup>1</load-on-startup>

<load-on-startup> When the server starts, it is true to the Servlet , and the smaller the value, the higher the priority load </load-on-startup>

The life cycle of JSP [Baidu]

Upon initialization of a dispatcherservlet, Spring MVC looks for a file named [Servlet-name]-servlet.xml In the web-inf Directory of your WEB application and creates the beans defined there, overriding the De Finitions of any beans defined and the same name in the global scope.

Jump:

Request Forwarding : The Address bar path does not change [ default jump mode ]

Redirect: Address bar Change

Configuring the View resolver

caused by:java.lang.IllegalStateException:Ambiguous mapping. Cannot map ' HomeController ' method

SPRINGMVC Environment Construction

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.