Запуск: mvn spring-boot:run
Коннект к базе (только 1 коннект возможен):
-
профиль prod
- приложение не работает jdbc:h2:file:~/db/javaops
- приложение работает: jdbc:h2:tcp://localhost:9092/~/db/javaops
-
профиль dev
- jdbc:h2:tcp://localhost:9092/mem:javaops
- Spring Boot and Intellij IDEA 14
- https://github.com/snicoll-demos/spring-boot-intellij-idea-webinar
- Spring Boot Reference Guide
- spring-projects/spring-boot
- Building REST services with Spring
-
Profiles.
-
Add H2. WebServer/TcpServer
-
Model User/Role. Repository UserRepository.
-
Security/ UserDetailService/ LoggedUser
-
Add Rest
-
Add mail
-
Switch to war: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-create-a-deployable-war-file
-
Run with active profile: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html#howto-set-active-spring-profiles ~/.bashrc export SPRING_PROFILES_ACTIVE=prod . ~/.bashrc
alias run='cd ~/javaops; nohup mvn spring-boot:run &'
-
Modify Tomcat config Tomcat location: http://stackoverflow.com/questions/12280372/where-can-i-find-the-tomcat-7-installation-folder-on-linux-ami-in-elastic-beanst /usr/share/tomcat8 http://stackoverflow.com/questions/32327522/spring-boot-yml-and-standalone-tomcat-8-server
- Sign-Up
- Launch instance
- Generate and convert key
- Assign an Elastic IP Address to Your Instance
- Enter by SSH (putty)
- Install Java JDK 1.8
- Install git
- Install maven (without java 7)
http://www.excelsior-usa.com/articles/tomcat-amazon-ec2-advanced.html http://mtdevuk.com/2015/02/10/how-to-deploy-a-spring-boot-application-to-amazon-aws-using-elastic-beanstalk/
http://www.baeldung.com/spring-mvc-static-resources
Run at 80 port: http://stackoverflow.com/questions/33703965/spring-boot-running-app-on-port-80
sudo su
yum install -y nginx
yum install mc
cat /etc/init.d/nginx
Ctrl+D (exit)
cat /etc/sysconfig/nginx cat /etc/nginx/nginx.conf
https://www.tollmanz.com/nginx-location-match-homepage/ http://stackoverflow.com/questions/11954255/nginx-how-to-set-index-html-as-root-file
sudo service nginx reload/stop/start
https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration
Open 80 port: http://stackoverflow.com/questions/5004159/opening-port-80-ec2-amazon-web-services
https://en.wikipedia.org/wiki/Chmod
http://stackoverflow.com/questions/6795350/nginx-403-forbidden-for-all-files namei -om /home/ec2-user/javaops/static/index.html
How do I run a Unix process in the background?
http://www.javabeat.net/spring-boot-external-configurations/
http://stackoverflow.com/questions/221379/hibernate-hbm2ddl-auto-update-in-production http://stackoverflow.com/questions/18077327/hibernate-hbm2ddl-auto-possible-values-and-what-they-do-any-official-explanat http://stackoverflow.com/questions/20089470/hibernate-is-not-auto-creating-a-table-that-does-not-exist-in-the-db
Comparison Preconditions in Java
Add AppConfig http://blog.codeleak.pl/2014/09/using-configurationproperties-in-spring.html http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#configuration-metadata-annotation-processor
http://www.jayway.com/2014/02/16/spring-propertysource/ http://www.mkyong.com/spring/spring-propertysources-example/ http://blog.jamesdbloom.com/UsingPropertySourceAndEnvironment.html http://stackoverflow.com/questions/13728000/value-not-resolved-when-using-propertysource-annotation-how-to-configure-prop
additional-spring-configuration-metadata.json
https://github.com/spring-cloud-samples/authserver
CompletionService over an ExecutorService
Omitting many details:
ExecutorService = incoming queue + worker threads CompletionService = incoming queue + worker threads + output queue
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#scheduling http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#scheduling-enable-annotation-support
10 советов по использованию ExecutorService
http://docs.spring.io/spring-javaconfig/docs/1.0.0.M4/reference/html/ch04s02.html
@JsonAutoDetect(fieldVisibility= ANY, getterVisibility= NONE, isGetterVisibility= NONE, setterVisibility= NONE)
Globally: https://spring.io/blog/2014/12/02/latest-jackson-integration-improvements-in-spring#with-spring-boot
spring-projects/spring-boot#2116
org/springframework/spring-webmvc/4.2.4.RELEASE/spring-webmvc-4.2.4.RELEASE-sources.jar!/org/springframework/web/servlet/mvc/method/annotation/ AbstractMessageConverterMethodProcessor.java:213
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-testing.html http://stackoverflow.com/questions/13866533/how-to-create-a-completed-future-in-java
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-spring-mvc-template-engines JSP limitation: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/
http://blog.codeleak.pl/2014/04/how-to-spring-boot-and-thymeleaf-with-maven.html Alt+R: http://stackoverflow.com/questions/27919315/spring-boot-hot-deployment-for-templates-and-resources-under-intellij
- http://www.thymeleaf.org/doc/articles/standarddialect5minutes.html
- http://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html
- Фрагменты
- Layouts
- Conditional expressions
Unescaped Text http://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#unescaped-text
Inlining http://www.thymeleaf.org/doc/tutorials/2.1/usingthymeleaf.html#inlining
http://blog.kaczmarzyk.net/2015/01/04/loading-view-templates-from-database-with-thymeleaf/ http://stackoverflow.com/questions/26609226/using-multiple-template-resolvers-with-spring-3-2-and-thymeleaf-2-1-3-for-emails
http://itchief.ru/lessons/bootstrap-3/110-bootstrap-3-callouts
https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot
http://stackoverflow.com/questions/28902374/spring-boot-rest-service-exception-handling 404: http://stackoverflow.com/questions/28902374/spring-boot-rest-service-exception-handling
- Spring Boot Reference Guide
- application-properties
- Spring Framework Reference Documentation
- Tutorial: Using Thymeleaf
Inner call: http://stackoverflow.com/questions/12115996/spring-cache-cacheable-method-ignored-when-called-from-within-the-same-class https://spring.io/blog/2012/05/23/transactions-caching-and-aop-understanding-proxy-usage-in-spring
https://habrahabr.ru/post/265563/ https://api.vk.com/method/users.get?domain=grigory.kislin&v=5.37&access_token=.. https://geektimes.ru/post/125155/
http://stackoverflow.com/questions/5787551/should-i-let-jpa-or-the-database-cascade-deletions http://stackoverflow.com/questions/2856460/hibernate-doesnt-generate-cascade https://dzone.com/articles/spring-caching-abstraction-and
https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html#boot-features-logging-file-output
http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-error-handling
org.springframework.web.servlet.DispatcherServlet.getHandler #1115