[Spring MVC] learning notes -- @ Controller, mvc -- @ controller
Before explaining @ Controller, describe the official Spring MVC document.
Some people may be like me. When I first got started with Spring
Overview
Following a major upgrade of Spring 2.0 to Spring MVC, Spring 2.5 introduced the annotation driver for spring MVC. Now you don't have to let Controller inherit any interfaces, do not need to define the mapping of the req
A typical Java web should look like this from the architecture:1. The Web browser sends an HTTP request to the server, which is acquired by the Controller (servlet) and processed.2. The Controller (Servlet) invokes the core business logic model section.3. Model carries out database access operations and returns the result of the operation to model.4. The controller gives the result of the business logic processing to the view (JSP) and dynamically outputs the HTML content.5. Dynamically generate
a global HTTP session, a bean definition corresponds to an instance. This scope is valid only in the case of a web-based spring ApplicationContext.6. What is the Spring MVC framework?Spring is equipped with a full-featured MVC framework for building Web applications.
Using idea 15 as a development tool一、四个 Module650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/5F/wKiom1hKsICSrBCGAAEIDxJakOg515.png-wh_500x0-wm_3 -wmp_4-s_3112128658.png "title=" four modules. png "alt=" wkiom1hksicsrbcgaaeidxjakog515.png-wh_50 "/>
API as an interface, jar package, providing dependency
Core Base module, providing entity classes, tool classes, jar packages, providing dependency
Consumer Dubbo in the consumer, control layer, war pack
aspect programming, coupling integration, MVC, etc, their respective growth will become even more powerful in the enterprise. Spring has already been added to the J2EE specification, and the J2EE world will be even more exciting ......
It may be that the rigid WEB framework of Struts1 is boring for Spring MVC. Especia
Every time you need a spring MVC Web project to test something, you're struggling with a Web project that doesn't have the simplest spring mvc on hand, write one now.> Release NotesTo introduce some packages first, spring's IOC, MVC package is needless to say. And Jackson's
Quickly build Spring MVC 4 Development Environment
Spring MVC, as a SpringFrameWork product, has received wide attention from developers since its birth. Now Spring MVC is evolving rapidly in Java. If there are more developers, if
Spring MVC as a springframework product, since the birth of the day, has been the attention of a wide range of developers, now spring MVC development in Java is thriving, and now if developers say, do not understand spring MVC, ma
First, the goalIn this post. I'm going to show you how to create your first Java EE application using Spring frameworks and Maven build . Second, informationMaven is a Building tool for a Java project (or self-building tools). It 's very much wanted with Ant or Gradle . Maven can proactively download components that are dependent on your project. Third, the requirements1 . Spring Tool Suite (STS) applied
); useroperationsservice.add (user); "/web-inf/jsp/addusersuccess.jsp"; 16 }17 @RequestMapping (value = "/adduser", method = Requestmethod.get), public String AddUser () {20Only part of the code is posted here (adduser code), the rest of the GetUser code is similar, you can download the source view.There are two methods, the Get and Post,get methods return directly to the form Fill page, which enables post to adduser add user.adduser.jspIII. Deployment RunFinally depl
Brief introductionSpringmvc as a front end MVC framework of the rising star, with the previous Struts similar, but more flexible, simple to configure and Spring and the fiery RESTful combination of better. Principlecorresponding to the above picture, combined Springmvc the source of the first from Web. XML speaking of. When the container starts, load Web. Xml. Whether it's a basic jsp and servlet Server, or
The former wanted to try out what's new with Spring MVC 4, and it's not that easy to really build a project with Maven in the IDE. Spring was laughing at the size of the EJB, and now it's making itself big, and then a spring Boot was launched to respond to the call for MicroServices.The advent of
ispring {public void get () {System.out.println (" Spring and Spring MVC integration success! ");}}Usercontroller:Package Cn.com.controller;import Javax.annotation.resource;import Javax.servlet.http.httpservletrequest;import Org.springframework.stereotype.controller;import Org.springframework.web.bind.annotation.requestmapping;import Org.springframework.web.cont
webapplicationcontext.rootwebapplicationcontextattribute as the attribute key and stores it in the ServletContext for easy access;
Webapplicationcontextutils.getwebapplicationcontext (ServletContext)
again, after the Contextloaderlistener listener is initialized, Start initializing the servlet configured in Web. XML, this servlet can be configured with multiple, for example, the most common Dispatcherservlet, the servlet is actually a standard front-end controller to forward, mat
MVC uses Spring. Net application IOC (dependency inversion) learning notes 3, spring. netioc
Now, we have basically set up the project framework, but there is still a problem in the project, that is, although the layer and layer use interfaces for isolation, but when instantiating interfaces, introduce the interface implementation class dependency, as shown in th
The first Spring mvc project created using Spring Tool Suite (STS) and Maven
I. Objectives
In this article, I will show you how to use Spring Frameworks and Maven build to create your first J2ee application.
II. Information
Maven is a java Project Build tool (or automatic build tool ). It works with Ant or Gradle very
Lifecycle of spring MVC
Before using spring MVC, we must understand the spring MVC process, for example:
See some previous instructions: (The handlermapping, handleradapter, handlerexceptionresovler, and viewresolver describ
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.