() {returnemail; } Public voidsetemail (String email) { This. email =email; } PublicUser () {} PublicUser (string name, string email) {Super(); This. Name =name; This. email =email; } @Override PublicString toString () {return"User [name=" + name + ", email=" + email + "]"; }}This will make it easy to display the verification results at the time of submission.Problem: Hibernate class library is not directly referenced in the code, but missing it, the validation results can not be disp
; Aspects integrated aspectj;expression expression Language; Instrument proxy tool; Instrument-tomcat:tomcat class loader extension;2:jms/messaging did not study, do not know the difference, the message service, Web:web development and other framework integration, WEBMVC:VC part, like STRUTS/JSF, webmvc portlet:webmvc enhancement; WebSocket: WebSocket communication, look at the source code or anti-compilation through the package name to know the package function, the individual package only one
, and Alias1,alias2,alias3,alias4 is an alias, which can be used as the bean's key value;6, you can use the The difference between ref and IDREFIn spring, both the Idref property and the ref attribute can be injected into the constructor-arg element and the property element, so what's the difference between it?Consider the following configuration:In fact, IDREF injects the ID of the target bean instead of the instance of the target bean, while the IDR
, beanpostprocessor will process it and automatically create a proxy object for the bean that satisfies the matching rule.http://blog.csdn.net/itomge/article/details/8861268http://uule.iteye.com/blog/894055Spring Weaving Concept Weaving (Weaving): The process of applying a facet (Aspect) to a target object to create a new proxy object, which generally occurs in the following time:
compile time : When a class file is compiled, this requires a special compiler to do so, such as AspectJ's
This article focuses on the use of annotations in the Java Spring Framework, including a description of the Java bean definition, and the friends you need can refer to the
1. Using spring annotations to inject properties
1.1. How we injected attributes before using annotationsImplementation of the class:?
Featured places in the past period"1" Java Web Technology Experience Summary"2" 15 top-level Java multithreading questions and answers, come and take a look."3" the interviewer most like to ask 10 Java face questions"4" from the zero-speaking Java, give you a clear way to learn! What to learn!!"5" Benefits: 100G
The purpose of this blog: ① summary of their own learning process, equivalent to study notes ② to share their own experience to everyone, learn from each other, communication, not commercialcontent inevitably appear problems, welcome to correct, exchange, discussion, you can leave a message, can also be contacted by the following ways. I Internet technology enthusiasts, Internet technology enthusiastsWeibo: Ivan is in 0221qq:951226918--------------------------------------------------------------
We need to use @component annotations to define a configuration class, in which we define the bean in the configuration class: Packagecom.moonlit.myspring;ImportOrg.springframework.context.annotation.Bean;Importorg.springframework.context.annotation.Configuration; @Configuration Public classMoonlitconfig {@Bean PublicWeapon Halberd () {return Newhalberd (); } @Bean PublicHero Guanyu () {guanyu Gy=NewGuanyu (); Gy.setweapon (Halberd ()); returnGy; }}The Guanyu classes here are as follows:
Tags: java EE spring database transaction mysqlSpring Operations transaction Management for connection to database 1, first of all, we know Spring manages transactions in two waysOr is it an annotated way ofWith @transactional in front of the service class, declare that all methods of the service require transaction management. Each business method starts with a
future of the EJB component model. The reality is that people are investing a lot in all aspects related to the Java EE. It may seem plausible to announce the abandonment of all previous work and to organize it, but it is not based on good business insights. EJB continues to evolve, and terminology, practices, and frameworks emerge (spring up), which make up for the inadequacy of the
back and forth between Java and XMLorg.springframework.test--simple encapsulation of test frameworks such as JUnitorg.springframework.transaction--declarative and simple programmatic transaction management for JDBC,HIBERNATE,JDO and JPAEnhancements to org.springframework.web.portlet--spring MVCorg.springframework.web.servlet--Support for j2ee6.0 servlet3.0The support of the org.springframework.web.struts--
${dalao.name} de yan zhi = ${dalao.yanzhi}
Entities are added
@Value ("${dalao.desc}")
Private String desc;
Output results
Random number
Some special needs, we do not want to set the value of the property is a fixed value, such as the server random port number, some number, etc., we can use ${radom} in the configuration to generate a random int,long or string
${random.int ()} = random int
${random.long} = Random Long
${random.int (50)} = random number within 50
${random.int (50,100)} = int rand
Personservicetest {private static Personservice personservice;@ Beforeclasspublic static void Setupbeforeclass () throws Exception {try {applicationcontext cxt = new Classpathxmlapplicat Ioncontext ("Beans.xml");p Ersonservice = (personservice) cxt.getbean ("Personservice");} catch (Exception e) {e.printstacktrace ();}} @Testpublic void Save () {for (int i = 0, i ResultsA bit of a twist in the middle, note that the value of the ref attribute inside the XML file must be copied, really TMD don't
1. What is Spring?
Spring is an open source development framework for Java enterprise-class applications. Spring is primarily used to develop Java applications, but some of the extensions are for Web applications that build an EE platform. The
framework, providing IOC and dependency injection Characteristics. The basic concept here is beanfactory, which provides a classic implementation of the factory pattern to eliminate the need for procedural singleton patterns and really allows you to isolate dependencies and configurations from the program Logic.2.Spring context: The context package, built on the core package, provides a framework for object access, Some like the Jndi registrar. The c
This article is from my translation of the Infoq Chinese station, the original address is: Http://www.infoq.com/cn/news/2015/07/spring-javaeeIn the Java community, the battle between Spring and Java EE is an eternal topic. In this debate, preachers, architects and fans from two camps are sparing no effort to defend the
In the Java community, the battle between Spring and Java EE is an eternal topic. In this debate, preachers, architects and fans from two camps are sparing no effort to defend the dignity of the party and try to persuade each other to join their own camp, but the result is that it is difficult for both sides to persuade each other, and each has a good reason to m
Reprinted from: Http://www.infoq.com/cn/news/2015/07/spring-javaeeIn the Java community, the battle between Spring and Java EE is an eternal topic. In this debate, preachers, architects and fans from two camps are sparing no effort to defend the dignity of the party and try to persuade each other to join their own camp
mode: Factory pattern2 Locator Mode: Service locator pattern3 Dependency Injection mode. Dependency injection can be divided into three types: constructor injection (constructor injection) setter injection (setter injection) and pretext injection (interface injection)* * Simple implementation of IOCWhat is a di mechanism? (DI = IOC, dependence injection, inverse of control)Dependency Injection (Dependecy injection) and control inversion (inversion of controls) are the same concept, specifically
Framework : The MVC framework is a full-featured MVC implementation of building Web applications;
√ What is a framework?
explanation One: develop a set of norms or rules (ideas) that everyone (programmers) in the specification or rule (thought) under work;
Explanation Two: Some cattle predecessors or a summary of the cattle predecessors of a set of solutions;
Two. Spring IoC (Control inversion) control inversion (inversion o
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.