Alibabacloud.com offers a wide variety of articles about spring log4j configuration example, easily find your spring log4j configuration example information here online.
1. PrefaceThe background of the company's old project is based on the spring framework, which also uses the Log4j.jar and other open source rack packages. In the new project, the spring and hibernate frameworks are used, using the Hibernate framework for persistence, simplifying SQL operations, and more. Hibernate profiles can be in two formats, one is hibernate.properties and the other is hibernate.cfg.xml
started, it willAutomatically finds the applicationcontext of Web-in Kusakabe. XML file.Of course, in order for the Contextloaderservlet to start with the application, you should configure this servlet toThe value of the Load-on-startup Servleto Load-on-startup is a little bit more appropriate, because it is guaranteed to applicationContext first created. If there is only one configuration file and the file name is ApplicationContext. XML, then inAdd
. equals (propertyName) {return true ;}} return false ;}}
AES encryption also requires a code. Here we need a 16-bit or 16-bit key. When spring reads a field containing encryptPropNames, it will execute the convertProperty Method for decryption.Note: The format saved in the. propertites file isJdbc. username = adminJdbc. password = 123456
3. Spring configuration
Detailed description of the instances in the JSP Spring configuration file, spring configuration file
Detailed description of the instances in the JSP Spring configuration file
Use spring
Spring injects attributes according to the XML configuration file, and Spring XML configuration file
Method 1 use the setter Method
package com.swift;public class Book { private String bookName; public void setBook(String bookName) { this.bookName = bookName; } @Override public String toString() {
Spring configuration file and springSpring configuration file OverviewIntroduction
Spring configuration files are "drawings" used to guide Spring factories in Bean generation, dependency injection, and Bean sample distribution. Th
about the namespace). Usually we use a shorter or more conventional name as the prefix for the namespace (for example, AOP here), But the exact prefix depends entirely on the individual. the prefix of the custom namespace is Legal. The clarity of XML files is enhanced with meaningful namespace Prefixes. So you can see that we usually configure the spring configuration
Bean configuration in Spring and Spring Bean Configuration
Original works, can be reproduced, but please mark the source address http://www.cnblogs.com/V1haoge/p/5859556.html
1. Bean configurations are generally configured in XML files.
2. Bean packages: org. springframework. beans and org. springframework. context
3.
automatic configuration (auto-configuration)
Automatic configuration (auto-configuration) is one of the most important features of spring boot, because the feature is based on the classpath of the application (this is mainly based on Maven Pom.xml decision), annotations and
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
database connection pool selection algorithm
By default, database connections can be configured automatically using the DataSource pool. Here is an algorithm for selecting a specific implementation: because of the performance and concurrency of the Tomcat data source connection pool, we always use it preferentially when Tomcat is available. If HIKARICP is available, we will use it. If Commons DBCP is available, we will use it, but it is not recommended in the production environment. Finally, if
Spring annotation configuration Transaction Management-problems, spring annotation configuration transactions
Configure in the context:
Note:
1. If the configuration is complete, an error is returned --
java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactory
Maven Project Build spring boot + spring mvc + JPA example, mavenmvc
This article describes how to build spring boot + spring mvc + JPA by using Maven:
Add Spring boot support and introduce related packages:
1. For maven projects,
)
Execution java -jar xxx.jar --spring.profiles.active=prod , you can observe that the service port is set to 3333 , that is, the configuration of the production environment (PROD)
According to the above experiment, we can summarize the multi-environment configuration ideas as follows:
application.propertiesThe common content is configured in and set to the spring.profiles.active=d
: association examples of MyBatis
MyBatis Study Notes Series 4: two forms of MyBatis association
MyBatis Study Notes Series 5: examples of integration between MyBatis and Spring
MyBatis Study Notes Series 6: examples of integration between MyBatis and Spring
MyBatis study notes 7: MyBatis one-to-multiple bidirectional Association
MyBatis Study Notes: MyBatis MapperScannerConfigurer
Spring Terminator-use spring Web ApplicationsProgramConfigure and integrate all parts (databases)
1. Add spring's dispatch servlet to Web. xml
2. Add the bean configuration file of spring. Note that the configuration file name must be in the following f
Spring + spring mvc + mybatis + react + reflux + webpack Web engineering example, mybatisreflux
Recently I wrote a Java Web project demo, which is built using maven;
The backend uses spring + spring mvc + mybatis;
The front end uses react + reflux + webpack and ES6 syntax. A
annotation. In this example, the base-package attribute tells Spring to search for all classes marked with the @ Configuration annotation in the com. sjf. bean package.
2. Define a configuration class
In Spring-based XML configuration
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.