creating bean with name 'sequencegenerator' defined in class path resource [applicationcontext. XML]: unsatisfied dependency expressed through bean property 'prefixgenerator': no qualifying bean of Type [COM. codeproject. jackie. springrecipesnote. springioc. prefixgenerator] is defined: Expected single matching bean but found 2: dateprefixgenerator, yearprefixgenerator; Nested exception is Org. springframework. beans. factory. nouniquebeandefinition
will not rip ....Note: In fact, the @Named annotation is a note annotated with the @qualifier annotation6. Inject an expression into the annotation:SPRING3.0 introduced @value, which allows us to use annotations to assemble string-type values and base-type values, such as: int, Boolean.@Value ("Chen Kozhan") Private String myName;The above is purely hard coded, and you may ask what is the point of setting a value to death.@Value +spel expression to show the powerful magic, here is not explained
Spring XML automatic prompts are configured in MyEclipse.
①window-> Preferences-> MyEclipse-> the Files and Editors-> XML-> XML Catalog
② Select User Specified Entries, click the Add button to eject a marquee, fill in the following three items
I. Location:d:\baiduyun\spring
to facilitate the learning and application of people, or from the configuration files, jars, beans start to pull up ...
1,web.xml configuration file Basic configuration
The corresponding relationship of the CXF servlet is configured here, and my intercept path is all URLs under/cxf/.
2,pom.xml configuration file, adding Maven dependencies required for CXF development
3, Simple spring config file, not much to say here.
4, for the needs of
SSM Framework integration has been reported that did not create an instance bean error, always thought is the code reason, repeated testing for a long time, only to find the reason is the spring configuration file is not imported correctly, is my error exampleWeb. Xml the way the spring configuration file is loaded depends mainly on the name of the profile and th
Advantages and disadvantages of XML configuration:The advantages are:1. The XML configuration method further reduces the coupling, making the application easier to extend, even if the configuration file is further modified and does not require engineering modification and recompilation.2. When dealing with large volumes of traffic, it should be better to use XML
This article mainly describes how to use the property injection and constructor injection implementation of our project to be used in the database parameters to the XML file, to facilitate deployment.
Spring MVC 4.2.6 ProjectSQL Server 2008 Database
This article describes the main use of applicationcontext and its implementation class implementation. The main use is classpathxmlapplicationcontext.Classpathx
. getsession (). getservletcontext ());
Copy code
However, in my project, no bean can be obtained using any of the above methods, because the above two methods are only valid for the bean configured in XML, and the annotation bean cannot be obtained, finally, I saw an article on "Spring Processing source code analysis for annotation (annotation)-scanning and reading bean definitions" on the Internet, and
Refer to the previous declarative transaction example: http://www.cnblogs.com/caoyc/p/5632198.htmlWe have made the corresponding changes. In DAO and in each class in the service, remove all annotation labels. Then provide a setxxx () method for each fieldFinally, configure the Applicationcontext.xml file. The contents are as follows:1XML version= "1.0" encoding= "UTF-8"?>2Beansxmlns= "Http://www.springframework.org/schema/beans"3Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"4Xmlns:aop= "
the first file found is loaded. Classpath* the use of the ClassLoader getresources () method;In the Pathmatchingresourcepatternresolver class, we can better understand the handling of its pair: if it starts with classpath*, it traverses classpath.It is still common in Java to read files when loading from a file:The way to get InputStream as Classpathresource is to use class loader.The way to get InputStream as Classpathresource is to use class loader.Public InputStream getInputStream () throws
Spring Mvc execution principle and xml annotation configuration (6)Spring MVC execution principle in Spring Mvc access process, each request first goes through many filters and is processed by DispatcherServlet; in a Spring MVC project, multiple dispatcherservlets can be con
Implement AOP programming using spring annotations and XMLTo implement the AOP programming annotation method, follow these steps:
1) Introduce jar files related to aop first (excellent aspectj aop components)
Spring-aop-3.2.5.RELEASE.jar [spring3.2 source code]
Aopalliance. jar [spring2.5 source code/lib/aopalliance]
Aspectjweaver. jar [spring2.5 source code/lib/aspectj] or [aspectj-1.8.2lib]
Aspectjrt. jar
Transfer from http://tianzongqi.iteye.com/blog/1458002Advantages and disadvantages of XML configuration:
Advantages:
The XML configuration approach further reduces coupling, making the application easier to scale, even if the configuration file is further modified and does not require engineering modification and recompilation.
The XML configura
The MAVEN project, which runs normally on idea, but then runs after it has been made into a jar package, will have an exception: Exception in thread "main" Org.springframework.beans.factory.parsing.BeanDefinitionParsingException:Configuration problem:unable to locate Spring Namespacehandler for XML schema namespace [http://www.springframework.org/schema/context]offending resource: URL [Jar:file:/home/jiashu
Refer to the previous declarative transaction example: http://www.cnblogs.com/caoyc/p/5632198.htmlWe have made the corresponding changes. In DAO and in each class in the service, remove all annotation labels. Then provide a setxxx () method for each fieldFinally, configure the Applicationcontext.xml file. The contents are as follows:1 XML version= "1.0" encoding= "UTF-8"?>2 Beansxmlns= "Http://www.springframework.org/schema/beans"3 Xmlns:xsi= "Http://
This is an article on sharing tips: Configure spring XML automatic hints in MyEclipse.
①window, Preferences, MyEclipse, Files and Editors-XML Catalog
② Select User Specified Entries, click the Add button to pop up a marquee, fill in the following three items
I. Location:d:\baiduyun\spring\spring_doc\soft\
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.