Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin committed Dec 25, 2014
1 parent e501181 commit a01cd0b
Showing 1 changed file with 3 additions and 90 deletions.
93 changes: 3 additions & 90 deletions examples/boot-more/README.txt
Original file line number Diff line number Diff line change
@@ -1,91 +1,4 @@
Things not in demo
What is more?

1. use applicactionContextxml

@ImportResource("applicationContext.xml")
public class BootServiceApplication {
}


2. use Jetty instead of Tomcat

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>

3. disable web in junit test use spring context

setWebEnvironment(false)

4. set system exit code

org.springframework.boot.ExitCodeGenerator

5. read configuration
@Value(${name})
String name

or

@Autowired
Environment env;
env.get

6. set the configuration file path

java -jar myproject.jar --spring.config.location=classpath:/default.properties,classpath:/override.properties

or just change the file name

java -jar myproject.jar --spring.config.name=myproject

7. active profile
java -jar myproject.jar --spring.profiles.active=dev,hsqldb

SpringApplication.setAdditionalProfiles(…​)

8. define logging level in appliation.properties

logging.level.org.springframework.web: DEBUG
logging.level.org.hibernate: ERROR

9. add spring-mvc defenation
wtrite WebMvcConfigurerAdapter without @EnableWebMvc

10. add servlet/filter

in application.properties

ServletRegistrationBean or FilterRegistrationBean

11. configure web

1. add context path
server.contextPath

2. set tomcat threads

12. JMX

1. add new jmx
@ManagedResource, @ManagedAttribute, @ManagedOperation

2. change jmx default domian name
endpoints.jmx.domain=myapp
endpoints.jmx.uniqueNames=true


13. APP id

14. Custom Health information
1. Use Jetty instead of Tomcat
2. Use JavaSimon, demo AOP and Servlet mapping definition

0 comments on commit a01cd0b

Please sign in to comment.