Problem:The current project is a background support for mobile apps, developed using spring MVC + mybaits + Shiro. The backend service interacts with the phone to send JSON data. If an exception occurs in the background, it will directly return to the exception page, showing the exception, if the 404 request is not a resource or 500 of such a problem, may result in the return of 404 and 500 exception page,
I. OverviewSpring Boot Actuator is a child project of spring boot. With it, you can add some production-level services to your app without requiring special configuration. This tutorial shows the use of Eclipse + maven to build a restful app from scratch.The effect of this application is to access http://localhost:8080/fuck?name=xxx, return a JSON string, and access http://localhost:8080/metrics to see some
Nothing is more sentimental than the decline of an era .
The whole society and people are in the pursuit of innovation, progress, growth, no one is willing to stop before, the old things slowly from our lives disappear really is so sad mody. or be replaced. I think some of them are, but some things are not.
Lantian and Blue Jade are not explaining the two distinct lives. With the progress of society, those disappearing art or folk arts may be in reality we can no longer see, this society is alw
This article provides you with Spring MVC Framework configuration skills to help you manage multiple instances of Spring-based web applications. This configuration governance topic is often ignored by academia, but this is especially important for practical Web development. This topic is not directly related to any specific technology. Therefore, we will describe
Introduction to Web MVC 1.1, the request-response model in Web development: In the Web world, the steps are as follows: 1, Web browsers (such as IE) initiate a request, such as access to http://www.cnblogs.com 2. The Web server (such as Tomcat) receives the request, processes the request (for example, the user adds it, saves the user), and finally produces a response (typically HTML). 3. After the Web serve
ViewName and generate the final user view based on the Render method in the first returned view object.Similar to handlermapping and Handeradapter, Dispatcherservlet also provides parameters to allow the user to specify whether to load only their own viewresolver, When the property detectallviewresolvers is set to false, spring MVC looks for the bean named Viewresolver as the current unique viewresolver.
-bidi-language:#0400;}-->
InWeb. xmlThe initialization configuration file is configured in(Applicationcontext. xml,Application-Flex.xml)Therefore, you mustSRCCreate the correspondingXMLFile(The file name must beWeb. xmlThe configuration file name set in is the same; otherwise, an error will be reported during loading.).
6. Configure applicationcontext. xml
VII. Spring MVC ConfigurationUsing
Spring and Redis)See Source: Scienjus/spring-restful-authorizationPackaged Tool class: Scienjus/spring-authorization-managerUsing aliases to accept parameters for an objectIt is common for the parameter names in the request to be different from the parameter names defined in the code, and in this case Spring provides
easier.Iv. what features does Spring boot offer? 1. No need to manually manage versions of dependent jar packagesSpring boot manages all dependent versions that it provides through the Spring Boot starter project, and these dependent versions are upgraded when spring boot is upgraded. You do not need to specify a version number, but you can also override the def
management, you do not need to explicitly provide log dependencies. For example, if you are creating an application context, the Dependency injection configuration for Maven is as follows:org.springframeworkspring-context4.1.1.RELEASERuntimeIt is important to note that if you do not want to compile with the spring API , scopes can be declared as runtime. Using a Sprin
Create a web Project
Suppose we have installed the dependent packages required by Spring, and some other extension packages, as well as the Jetty container and ps: Jetty container installation. See the previous article.
To run a web project, you must have a web. xml configuration file that is placed under the WebContent/WEB-INF/directory.
[Html]Xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: web = "http://java.sun.com/xml/ns/javaee/web-app_2_5.x
and the transfer of Ajax. While rest emphasizes binding requests to resources through URIs, if you combine rest with Ajax technology, you can create an effective complement, and we might as well extend the programming ideas mentioned above, and still take the order information with ID 1 as an example:
Ajax initiation Request: HTTP://WWW.COOLFANCY.COM/REST/ORDER/1;
Bind the request to the background entity through a restful URI design;
Previous post | Next articleget static resource file Css,js in Spring MVC program, picturePath to the fileSummary of IssuesAuthor: Light Dancing Sheep Date: 2012-11-26http://www.blogjava.net/fiele/archive/2014/08/24/417283.htmlUsing Spring MVC to develop the application, for beginners have a very headache, that is, the
Spring MVC interceptor and springmvc blocker
Spring provides us:
Org. springframework. web. servlet.HandlerInterceptorInterface,
Org. springframework. web. servlet. handler.HandlerInterceptorAdapterAdapter,
You can easily implement your own interceptor by implementing this interface or inheriting this class.
For example
Previous post | Next articleget static resource file Css,js in Spring MVC program, picturePath to the fileUsing Spring MVC to develop the application, for beginners have a very headache, that is, the program data has been queried, but the interface style is still very ugly, loading css,js, pictures and other resource f
}preprocessing, post processing (call service and return Modelandview, but no page rendering), return processing (page already rendered)In the Prehandle, the coding, security control and so on can be processed;In Posthandle, there is an opportunity to modify the Modelandview;In aftercompletion, logging is possible based on whether an ex is null to determine if an exception has occurred.Part 2nd Interceptor ConfigurationIf you use spring
This example accesses a static or dynamic page through the Start by creating a Web project and introducing the relevant jar package:Create a controller class, Webcontroller.java1 PackageCom.young.saticpage.controller;2 3 ImportOrg.springframework.stereotype.Controller;4 Importorg.springframework.web.bind.annotation.RequestMapping;5 ImportOrg.springframework.web.bind.annotation.RequestMethod;6 7 @Controller8 Public classWebcontroller {9@RequestMappin
mentioned above, and still take the order information with ID 1 as an example:
Ajax initiation Request: HTTP://WWW.COOLFANCY.COM/REST/ORDER/1;
Bind the request to the background entity through a restful URI design;
The background entity returns the Json/xml data containing the product information;
The foreground uses a script to display the data.
We use spring
If you want to use multiple view parsers in a spring MVC Application, you can use order properties to set the order of precedence. The following example shows how to use and in the Spring Web MVC framework ResourceBundleViewResolver InternalResourceViewResolver .The multiple
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.