---restore content starts---Problem: I use the spring framework in a Web application, but some modules or components are not hosted for spring, such as some may be a WebService service class, what if I want to use managed objects in these unmanaged classes? Naturally, we need to get a reference to the Spring container object ApplicationContext, and my idea is tha
Spring-boot is a set of frameworks for a fast-build environment that is designed to reduce the configuration of XML as much as possible to simplify the initial setup and development of new spring applications. The framework uses a specific approach to configuration, which eliminates the need for developers to define boilerplate configurations.Nonsense not much to say, about
Next we will create a web project. For simplicity, We will directly use the template in Virgo to create a new project. The control layer uses spring MVC 3.Create a WEB Project
Open STS and create a project. Select sprinng template project.
Figure: Create a spring template project
Select spring MVC Project
Figure: Template Selection
Enter the project name
[Spring] uses Spring's AbstractRoutingDataSource to implement multi-data source switching. spring dynamically switches data sources.
Recently, because the project needs to synchronize data between two projects, specifically, Project 1 data is synchronized to project 2 through the message queue, because this update operation also involves updating data in multiple databases, you need to switch between multip
1. Click Create New Project2. Select Spring initializer and jdk1.8 Note: Project names are lowercase letters3, now only need a create a Web, choose a good4, no use of the file, you can delete5. pom.xml file automatically introduces web and Java related packages and packaged plugins Both the main program and the test program are automatically generated.Spring Boot series (ii) Spring initializer quickly crea
If you use JUnit's liberary, you can complete the test of the program.
In spring development, Spring provides the relevant test modules, which makes it easy to load the configuration files and test them.
How to use:
The first step:
Introduction of the test package, found in the download of the Spring package Lib:
Add jar to project and build path
Step Two: Wr
specify the @ sessionattributes (types = {user. class, Dept. class}, value = {"attr1", "attr2 "}).
The above describes how to place attributes in modelmap and How to Make attributes in modelmap have the range of the session domain. In addition to accessing attributes in modelmap through traditional methods on the JSP view page, readers may ask: Can I bind attributes in modelmap to the input parameters of the request processing method? The answer is yes. S
When using spring, I also often use the bean tags, beans tags, import tags, AOP tags, and so on.The following is a brief introduction to spring's default self-tagged parsing process.Validation mode (dtdxsd)The DTD is basically obsolete, and now spring's validation mode is basically using an XSD file as the validation mode of the XML document, and the XSD file can be used to check whether the XML conforms to the specification and is valid. When validat
Introduce Spring's core mechanism dependency injection and spring's Core Mechanism
Introduce Spring's core mechanism dependency Injection
For general Java projects, they all have a more or less dependent relationship, that is, they are composed of some mutual collaboration objects. Spring calls this cooperative relationship dependency. For example, if component A calls the method of component B, component A depends on Component B. Dependency injection
Development, starting from demand · spring here, spring here
First, I want to express my position in the big-character slogans:The framework non-core features you use is the same as the clothes women wear. the fewer the clothes, the better!
Let's talk about it.
Let's keep staring at huajie -- ah, no -- it's BeanFactory.
public static SearchService getSearchService() {if(MOCK) {return new SearchServiceM
As an enterprise-class Web application, the MVC framework is essential. Spring MVC is currently widely used, and this article describes how to implement the integration of the spring, MyBatis, and spring MVC frameworks in OSGi applications, where the integration of spring MVC is difficult because
Introduction: Spring Model-view-controller (MVC) is the most widely used module in the Spring Framework. It is based on a clean design and offers a lot of out-of-the-box classes. This tutorial is the fifth part of a series of tutorials (a total of six parts) detailing Spring MVC by adding more features to the phone's sample application. In this process, you will
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
1. The content of the article is summarized:The spring framework is MAVEN-enabled, because the jar packages packaged by all the modules of the spring framework and other jar packages that spring relies on are stored in a central Maven repository, and if your project is managed using MAVEN, Then you can use MAVEN in your project to introduce the
The Spring framework provides a good integration mechanism for remote access technologies. Currently, spring supports the following technologies:1. Remote Method Invocation (RMI ).
Through rmiproxyfactorybean and rmiserviceexporter, spring supports traditional RMI interfaces defined by Java. RMI. Remote and Java. RMI. RemoteException, providing transparent access
First, spring's overall architecture and modulesSecond, the module classification:1. Core ContainerCore container contains core, Beans, Context, and expression language modules2. Data access/integrationData access/integration contains JDBC, ORM, OXM, JMS, and transaction modules3. WebThe Web layer contains the Web, Web-servlet, web-struts, web-porlet modules.4. AOP5. TestTest module includes JUnit and testng for testing spring componentsthree, the mod
For details see: http://blog.csdn.net/it_man/article/details/4402245Recently, I bought this Spring starter book: Spring in Action. The view from the hotel was good. It's a bit of a starter. Manning's book is still good, although I do not like those who only see Manning book the same focus on Manning, but with reverence for the mood and passion browse through again. Once again, the core concepts of IOC, DI,
Looking back on the Web development process on the Java platform, from the beginning of the servlet, to the JSP flourish, then the servlet+jsp era, and finally evolve into the era of web development framework prevails. General access to a new web framework, would like to ask the advantages of this framework where? Or better than other frameworks? The conversion framework might not be a good idea if you are not using the Spring MVC framework and you ar
Spring cache mechanism instance code, spring cache instance
Spring's caching mechanism is flexible and can cache any Bean or Bean method in the container. Therefore, this cache mechanism can be cached at any level of the Java EE application.
The underlying layer of Spring cache also needs to be implemented using other caching tools, such as EhCache (Hibernate cac
Retrieve Spring-managed beans in common classes and Spring beans
1. Add the following classes to the project:
Import org. springframework. context. applicationContext; import org. springframework. context. applicationContextAware;/*** saves Spring ApplicationContext with static variables. ApplicaitonContext can be retrieved anywhere in the code. **/public cl
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.