the object to the specified response information Data Transformation: Data conversion for a request message. such as string conversion to Integer, double data Radical: Data formatting of the request message. such as converting strings to formatted numbers or formatted dates data validation: Verifying the validity of the data (length, format, etc.), validating the results stored in Bindingresult or error 5. When handler executes, returns a Modelandview object; 6 to dispatcherservlet
First, @RequestMapping IntroductionUse @RequestMapping in spring MVC to map a request, that is, to specify which URL requests the controller can handle, which is equivalent to configuring the servlet in Web. xmlThe mapping effect is consistent. Let's look at the source code for the Requestmapping annotation class first:@Target ({elementtype.method, elementtype.type}) @Retention (retentionpolicy.runtime) @Do
1. OverviewThe following diagram is the overall flow of Spring MVC processing requests, where front controller refers to the Dispatcherservlet class.1. All client requests are sent to Dispatcherservlet and processed by Dispacherservlet.2.DispacherServlet distributes the request to different controller classes, and the controller class handles the corresponding re
Spring mvc-File Upload
When uploading a file, we need to use the file upload parser. In fact, it is no stranger. It is just an extension of httpServletRequest, so that it can better process file uploads. The extension interface name is: org. springframework. web. multipart. multipartHttpServletRequest
First, let's take a look at the underlying architecture of the
the object to the specified response information data transformation: data conversion for a request Message. such as string conversion to integer, double data radical: data formatting of the request Message. such as converting strings to formatted numbers or formatted dates data validation: Verifying the validity of the data (length, format, etc.), validating the results stored in Bindingresult or error 5. When handler executes, returns a Modelandview object; 6 to Dispatcherservlet
, converting the object to the specified response informationData transformation: Data conversion for a request message. such as string conversion to Integer, double, etc.Data is initialized: Data is formatted for the request message. such as converting a string into a formatted number or a formatted dateData validation: Verifying the validity of the data (length, format, etc.), and verifying that the results are stored in Bindingresult or error5. After the completion of handler execution, retur
(); }}application.propertiesConfiguring the Eureka Service Registry inspring.application.name=ribbon-consumerserver.port=3333eureka.client.serviceUrl.defaultZone= http://localhost:1111/eureka/Launch the app and visit two times: Http://localhost:3333/addThen, open the Compute-service's two service providers, output a log content similar to the following:
The port is 2222 the service-provider log:
As you can see, the two Compute-service service ports that were previously started were cal
build Spring MVC under Eclipse
One, new dynamic Web Project
A Web project is the most basic, only look at 3 places, in the root directory (this directory is generally used to call webcontent or Webroot) have:1.webroot/web-inf/web.xml Boot file2.webroot/web-inf/classes/the compiled class file, which establishes the subpath according to package3.webroot/web-inf/lib/jar Package (Note that no subdirectories can
Advantages of Spring MVC and Struts2, mvcstruts2
We use the traditional configuration file method when using struts2, and do not use the legendary 0 configuration. Spring3 mvc can be considered to have 100% Zero Configuration (except for configuring spring mvc-servlet.xml ).
]", "status": "1", "createTime": "2017-06-26" }, "roleIds": "100", "tokenInfo": { "accessToken":"4de55a69-e372-4766-acd3-1c419d6f2fda", "tokenType": "bearer", "webTokent":"uHSLjfJoQwU4t4PAqCzH1SN0fp7PUWKluPNS+x1dZ8R9Gx+NJkBI7w==", "refreshToken":"d3d71594-5c3f-4a68-a7e5-b8d21c4fa73b", "expiresIn": 34644, "scope": "read write" } Note: You can test with the Postman toolFramework Design idea: Provide independent Commonservice-sso microservices, provide com
recommend a series of blog to learn spring, this article is also read one of the blog wrote.
poke here .
The Spring Web MVC Framework is a request-driven web framework and is also designed using a front-end controller pattern, distributed to the appropriate page controller (action/processor) for processing according to the request mapping rules.
completion of handler execution, return a Modelandview object to Dispatcherservlet;6. Based on the returned Modelandview, select a suitable viewresolver (must be a viewresolver already registered in the spring container) to return to Dispatcherservlet;7. Viewresolver combine model and view to render the view8. Return the rendering results to the client.Spring Workflow DescriptionWhy does spring use only on
listeners of the event to be processed by the broadcaster.Is the structure diagram of the event mechanism to Download650) this.width=650; "height=" 525 "width=" src= "http://dl2.iteye.com/upload/attachment/0119/7761/" 709446ae-70da-30ed-a7bd-05b2a23241f2.jpg "title=" Click to view the original size picture "class=" Magplus "style=" border:0px; "/>Spring Event Publishing mechanismIn
Reprint Please specify source: http://blog.csdn.net/pearyangyang/article/details/42467729Spring MVC is one of the Spring family framework, which is separated by the controller and model objects and integrates with spring technology to make the architecture of the system clear.Previously prepared:1.JDK Installation and
In the previous article we covered the content of the velocity template engine, and below we describe how to use velocity in spring mvc.
--------------------------------------------------------------------------------------------------------------- -----------------------------------------------
Velocity is a Java template engine.
Similar to Jsp,freemarker, it is used to display Web content.
Unlike JSPs, Ve
In this article we build our code based on the architecture diagram. According to the micro-service design idea, combined with Springcloud some excellent projects, such as service discovery, governance, configuration management, routing load, security control and other excellent solutions, using MAVEN technology to modular, service, atomized encapsulation and build, but also for the post-grayscale publishin
Spring MVCis actually a Java implementation of the Web MVC design pattern of the request-driven type of the lightweight web framework, is to use the MVC architecture pattern idea, the web layer decoupling, so based on the request-driven refers to the request-response model.The front controller is Dispatcherservlet, and
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.