├── data ├── advqueries │ ├── data │ │ └── elasticsearch │ │ │ └── nodes │ │ │ └── 0 │ │ │ ├── node.lock │ │ │ └── _state │ │ │ └── global-2.st │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── logback.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── therealdanvega │ │ │ │ ├── repository │ │ │ │ └── AuthorRepository.java │ │ │ │ ├── Application.java │ │ │ │ └── json │ │ │ │ └── JsonDateSerializer.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── H2demoApplicationTests.java │ └── .springBeans ├── jdbcdemo │ ├── data │ │ └── elasticsearch │ │ │ └── nodes │ │ │ └── 0 │ │ │ ├── node.lock │ │ │ └── _state │ │ │ └── global-7.st │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── templates │ │ │ │ │ ├── author │ │ │ │ │ │ └── list.html │ │ │ │ │ └── post │ │ │ │ │ │ └── list.html │ │ │ │ ├── application.properties │ │ │ │ ├── logback.xml │ │ │ │ ├── static │ │ │ │ │ └── css │ │ │ │ │ │ └── blog.css │ │ │ │ └── schema-h2.sql │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── therealdanvega │ │ │ │ ├── JDBCDemoApplication.java │ │ │ │ ├── service │ │ │ │ └── PostService.java │ │ │ │ └── controller │ │ │ │ └── HomeController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── H2demoApplicationTests.java │ └── .springBeans ├── mongodemo │ ├── data │ │ └── elasticsearch │ │ │ └── nodes │ │ │ └── 0 │ │ │ └── node.lock │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── templates │ │ │ │ │ ├── author │ │ │ │ │ │ └── list.html │ │ │ │ │ └── post │ │ │ │ │ │ └── list.html │ │ │ │ ├── application.properties │ │ │ │ └── static │ │ │ │ │ └── css │ │ │ │ │ └── blog.css │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── therealdanvega │ │ │ │ ├── repository │ │ │ │ ├── AuthorRepository.java │ │ │ │ └── PostRepository.java │ │ │ │ ├── MongoDBApplication.java │ │ │ │ ├── controller │ │ │ │ ├── AuthorController.java │ │ │ │ └── HomeController.java │ │ │ │ └── service │ │ │ │ └── PostService.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── H2demoApplicationTests.java │ └── .springBeans ├── blogrefactor │ ├── data │ │ └── elasticsearch │ │ │ └── nodes │ │ │ └── 0 │ │ │ ├── node.lock │ │ │ └── _state │ │ │ └── global-32.st │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── templates │ │ │ │ │ ├── author │ │ │ │ │ │ └── list.html │ │ │ │ │ └── post │ │ │ │ │ │ └── list.html │ │ │ │ ├── application.properties │ │ │ │ ├── logback.xml │ │ │ │ └── static │ │ │ │ │ └── css │ │ │ │ │ └── blog.css │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── therealdanvega │ │ │ │ ├── repository │ │ │ │ ├── AuthorRepository.java │ │ │ │ └── PostRepository.java │ │ │ │ ├── BlogApplication.java │ │ │ │ ├── controller │ │ │ │ ├── AuthorController.java │ │ │ │ └── HomeController.java │ │ │ │ └── service │ │ │ │ └── PostService.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── H2demoApplicationTests.java │ └── .springBeans └── h2demo │ ├── bin │ └── src │ │ └── main │ │ └── resources │ │ └── application.properties │ └── src │ ├── main │ ├── resources │ │ ├── application.properties │ │ └── logback.xml │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── repository │ │ ├── AuthorRepository.java │ │ └── PostRepository.java │ └── test │ └── java │ └── com │ └── therealdanvega │ └── H2demoApplicationTests.java ├── core-spring ├── beans │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ ├── abc │ │ │ └── foo │ │ │ │ └── NotificationService.java │ │ │ └── therealdanvega │ │ │ └── PageController.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── SpringBeansApplicationTests.java ├── auto-configure │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── AutoConfigureApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── AutoConfigureApplicationTests.java ├── configuration-properties │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── ConfigpropsApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── ConfigpropsApplicationTests.java ├── profiles │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ ├── application-development.properties │ │ │ ├── application-production.properties │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── ProfileDemoApplication.java │ │ │ ├── PageController.java │ │ │ ├── DataSourceConfig.java │ │ │ └── DataSource.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── ProfileDemoApplicationTests.java └── external-config │ └── src │ ├── main │ ├── resources │ │ ├── application.yml │ │ └── application.properties │ └── java │ │ └── com │ │ └── therealdanvega │ │ ├── ExternalConfigApplication.java │ │ └── PageController.java │ └── test │ └── java │ └── com │ └── therealdanvega │ └── ExternalConfigApplicationTests.java ├── rest ├── rest-starter │ ├── bin │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ ├── service │ │ │ └── PostService.java │ │ │ └── controller │ │ │ └── AuthorController.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── RestStarterApplicationTests.java ├── rest-template │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── static │ │ │ │ └── data │ │ │ │ └── weather.json │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── RestTemplateApplication.java │ │ │ ├── controller │ │ │ └── HomeController.java │ │ │ └── domain │ │ │ ├── Location.java │ │ │ └── Weather.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── RestTemplateApplicationTests.java ├── halbrowser │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ └── domain │ │ │ └── Teaser.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── RestStarterApplicationTests.java ├── rest-error-handling │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── application.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── therealdanvega │ │ │ │ ├── repository │ │ │ │ ├── AuthorRepository.java │ │ │ │ └── PostRepository.java │ │ │ │ ├── exception │ │ │ │ └── PostNotFoundException.java │ │ │ │ ├── service │ │ │ │ └── PostService.java │ │ │ │ └── controller │ │ │ │ └── AuthorController.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── RestStarterApplicationTests.java │ └── .springBeans └── hypermedia │ ├── src │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ └── domain │ │ │ └── Teaser.java │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── RestStarterApplicationTests.java │ └── .springBeans ├── security ├── blog │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── templates │ │ │ │ │ ├── author │ │ │ │ │ │ └── list.html │ │ │ │ │ └── post │ │ │ │ │ │ └── list.html │ │ │ │ ├── application.properties │ │ │ │ ├── logback.xml │ │ │ │ ├── static │ │ │ │ │ └── css │ │ │ │ │ │ └── blog.css │ │ │ │ └── application-production.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── therealdanvega │ │ │ │ ├── repository │ │ │ │ ├── AuthorRepository.java │ │ │ │ └── PostRepository.java │ │ │ │ ├── controller │ │ │ │ ├── AuthorController.java │ │ │ │ └── HomeController.java │ │ │ │ ├── SecurityDemoApplication.java │ │ │ │ └── service │ │ │ │ └── PostService.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── H2demoApplicationTests.java │ └── .springBeans ├── security-custom │ ├── bin │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ └── index.html │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── controller │ │ │ ├── HomeController.java │ │ │ └── PostController.java │ │ │ ├── SecurityCustomApplication.java │ │ │ └── config │ │ │ └── WebConfig.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── SecurityCustomApplicationTests.java ├── security-starter │ ├── bin │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ └── SecurityStarterApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── SecurityStarterApplicationTests.java └── security-springdata │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── service │ │ │ └── UserService.java │ │ │ ├── repository │ │ │ └── UserRepository.java │ │ │ ├── controller │ │ │ ├── HomeController.java │ │ │ └── PostController.java │ │ │ ├── SecurityCustomApplication.java │ │ │ └── config │ │ │ └── WebConfig.java │ └── resources │ │ ├── templates │ │ └── index.html │ │ └── application.properties │ └── test │ └── java │ └── com │ └── therealdanvega │ └── SecurityCustomApplicationTests.java ├── guides ├── sending-email │ ├── bin │ │ └── src │ │ │ └── main │ │ │ └── resources │ │ │ └── application.properties │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── SendingEmailApplication.java │ │ │ └── domain │ │ │ └── User.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── SendingEmailApplicationTests.java └── sending-email-async │ ├── bin │ └── src │ │ └── main │ │ └── resources │ │ └── application.properties │ └── src │ ├── main │ ├── resources │ │ └── application.properties │ └── java │ │ └── com │ │ └── therealdanvega │ │ ├── SendingEmailAsyncApplication.java │ │ └── domain │ │ └── User.java │ └── test │ └── java │ └── com │ └── therealdanvega │ └── SendingEmailAsyncApplicationTests.java ├── web-applications ├── bower │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── static │ │ │ │ │ ├── lib │ │ │ │ │ └── jquery │ │ │ │ │ │ ├── src │ │ │ │ │ │ ├── outro.js │ │ │ │ │ │ ├── selector.js │ │ │ │ │ │ ├── var │ │ │ │ │ │ │ ├── arr.js │ │ │ │ │ │ │ ├── rnotwhite.js │ │ │ │ │ │ │ ├── strundefined.js │ │ │ │ │ │ │ ├── push.js │ │ │ │ │ │ │ ├── slice.js │ │ │ │ │ │ │ ├── class2type.js │ │ │ │ │ │ │ ├── concat.js │ │ │ │ │ │ │ ├── indexOf.js │ │ │ │ │ │ │ ├── pnum.js │ │ │ │ │ │ │ ├── toString.js │ │ │ │ │ │ │ ├── hasOwn.js │ │ │ │ │ │ │ └── support.js │ │ │ │ │ │ ├── ajax │ │ │ │ │ │ │ ├── var │ │ │ │ │ │ │ │ ├── rquery.js │ │ │ │ │ │ │ │ └── nonce.js │ │ │ │ │ │ │ ├── parseJSON.js │ │ │ │ │ │ │ └── parseXML.js │ │ │ │ │ │ ├── css │ │ │ │ │ │ │ ├── var │ │ │ │ │ │ │ │ ├── rmargin.js │ │ │ │ │ │ │ │ ├── cssExpand.js │ │ │ │ │ │ │ │ ├── rnumnonpx.js │ │ │ │ │ │ │ │ ├── isHidden.js │ │ │ │ │ │ │ │ └── getStyles.js │ │ │ │ │ │ │ ├── hiddenVisibleSelectors.js │ │ │ │ │ │ │ ├── addGetHookIf.js │ │ │ │ │ │ │ └── swap.js │ │ │ │ │ │ ├── data │ │ │ │ │ │ │ ├── var │ │ │ │ │ │ │ │ ├── data_priv.js │ │ │ │ │ │ │ │ └── data_user.js │ │ │ │ │ │ │ └── accepts.js │ │ │ │ │ │ ├── manipulation │ │ │ │ │ │ │ ├── var │ │ │ │ │ │ │ │ └── rcheckableType.js │ │ │ │ │ │ │ └── _evalUrl.js │ │ │ │ │ │ ├── core │ │ │ │ │ │ │ └── var │ │ │ │ │ │ │ │ └── rsingleTag.js │ │ │ │ │ │ ├── traversing │ │ │ │ │ │ │ └── var │ │ │ │ │ │ │ │ └── rneedsContext.js │ │ │ │ │ │ ├── event │ │ │ │ │ │ │ ├── support.js │ │ │ │ │ │ │ └── ajax.js │ │ │ │ │ │ ├── attributes.js │ │ │ │ │ │ ├── deprecated.js │ │ │ │ │ │ ├── effects │ │ │ │ │ │ │ └── animatedSelector.js │ │ │ │ │ │ ├── selector-sizzle.js │ │ │ │ │ │ ├── queue │ │ │ │ │ │ │ └── delay.js │ │ │ │ │ │ ├── jquery.js │ │ │ │ │ │ └── exports │ │ │ │ │ │ │ └── global.js │ │ │ │ │ │ ├── bower.json │ │ │ │ │ │ └── .bower.json │ │ │ │ │ ├── images │ │ │ │ │ └── tfsbg_2012.jpg │ │ │ │ │ └── css │ │ │ │ │ └── style.css │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── toysforshots │ │ │ │ └── ToysforshotsApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── toysforshots │ │ │ └── ToysforshotsApplicationTests.java │ ├── .bowerrc │ └── bower.json ├── gspdemo │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ ├── _subtemplate.gsp │ │ │ │ ├── _template_body.gsp │ │ │ │ └── layouts │ │ │ │ ├── sample.gsp │ │ │ │ └── main.gsp │ │ └── java │ │ │ └── com │ │ │ └── toysforshots │ │ │ ├── taglib │ │ │ └── FormatTagLib.groovy │ │ │ ├── ToysforshotsApplication.java │ │ │ └── controller │ │ │ └── HomeController.java │ │ └── test │ │ └── java │ │ └── com │ │ └── toysforshots │ │ └── ToysforshotsApplicationTests.java ├── starter │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ ├── static │ │ │ │ │ ├── images │ │ │ │ │ │ └── readme.md │ │ │ │ │ ├── css │ │ │ │ │ │ └── readme.md │ │ │ │ │ ├── js │ │ │ │ │ │ └── readme.md │ │ │ │ │ └── index.html │ │ │ │ └── templates │ │ │ │ │ └── readme.md │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── toysforshots │ │ │ │ └── ToysforshotsApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── toysforshots │ │ │ └── ToysforshotsApplicationTests.java │ └── readme.md ├── controllers │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ │ └── post.html │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── ControllersApplication.java │ │ │ ├── controller │ │ │ └── ExceptionControllerAdvice.java │ │ │ └── domain │ │ │ └── Post.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── ControllersApplicationTests.java ├── errors │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── static │ │ │ │ ├── 404.html │ │ │ │ └── css │ │ │ │ │ └── blog.css │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── controller │ │ │ └── ExceptionControllerAdvice.java │ │ │ ├── ErrorsApplication.java │ │ │ └── domain │ │ │ └── Post.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── ErrorsApplicationTests.java ├── static-content │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── static │ │ │ │ ├── js │ │ │ │ └── application.js │ │ │ │ ├── css │ │ │ │ ├── starter-template.css │ │ │ │ └── style.css │ │ │ │ ├── images │ │ │ │ └── tfsbg_2012.jpg │ │ │ │ └── lib │ │ │ │ └── bootstrap │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ └── npm.js │ │ └── java │ │ │ └── com │ │ │ └── toysforshots │ │ │ └── ToysforshotsApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── toysforshots │ │ └── ToysforshotsApplicationTests.java ├── thymeleaf │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.properties │ │ │ └── static │ │ │ │ └── css │ │ │ │ └── blog.css │ │ └── java │ │ │ └── com │ │ │ └── toysforshots │ │ │ └── ThymeleafApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── toysforshots │ │ └── ThymeleafApplicationTests.java └── internationalization │ ├── src │ ├── main │ │ ├── resources │ │ │ ├── messages.properties │ │ │ ├── messages_fr.properties │ │ │ ├── messages_es.properties │ │ │ ├── application.properties │ │ │ └── static │ │ │ │ └── css │ │ │ │ └── blog.css │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── InternationalizationApplication.java │ │ │ └── controller │ │ │ └── PostController.java │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── InternationalizationApplicationTests.java │ └── .settings │ ├── org.eclipse.m2e.core.prefs │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.wst.common.project.facet.core.xml │ └── org.eclipse.jdt.core.prefs ├── crud ├── edit │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── post │ │ │ │ │ ├── readme.md │ │ │ │ │ └── view.html │ │ │ │ └── author │ │ │ │ │ ├── readme.md │ │ │ │ │ └── list.html │ │ │ ├── messages.properties │ │ │ ├── logback.xml │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── Application.java │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ ├── service │ │ │ └── AuthorService.java │ │ │ ├── controller │ │ │ ├── HomeController.java │ │ │ └── AuthorController.java │ │ │ ├── json │ │ │ └── JsonDateSerializer.java │ │ │ └── config │ │ │ └── WebConfig.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── H2demoApplicationTests.java ├── read │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── post │ │ │ │ │ ├── readme.md │ │ │ │ │ └── view.html │ │ │ │ └── author │ │ │ │ │ ├── readme.md │ │ │ │ │ └── list.html │ │ │ ├── logback.xml │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── Application.java │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ ├── service │ │ │ └── AuthorService.java │ │ │ ├── controller │ │ │ ├── HomeController.java │ │ │ └── AuthorController.java │ │ │ ├── json │ │ │ └── JsonDateSerializer.java │ │ │ └── config │ │ │ └── WebConfig.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── H2demoApplicationTests.java ├── create │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── author │ │ │ │ │ ├── readme.md │ │ │ │ │ └── list.html │ │ │ │ └── post │ │ │ │ │ ├── readme.md │ │ │ │ │ ├── list.html │ │ │ │ │ └── view.html │ │ │ ├── logback.xml │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── Application.java │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ ├── service │ │ │ └── AuthorService.java │ │ │ ├── controller │ │ │ ├── HomeController.java │ │ │ └── AuthorController.java │ │ │ ├── json │ │ │ └── JsonDateSerializer.java │ │ │ └── config │ │ │ └── WebConfig.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── H2demoApplicationTests.java ├── delete │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── author │ │ │ │ │ ├── readme.md │ │ │ │ │ └── list.html │ │ │ │ └── post │ │ │ │ │ ├── readme.md │ │ │ │ │ ├── list.html │ │ │ │ │ └── view.html │ │ │ ├── messages.properties │ │ │ ├── logback.xml │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── Application.java │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ ├── service │ │ │ └── AuthorService.java │ │ │ ├── controller │ │ │ ├── HomeController.java │ │ │ └── AuthorController.java │ │ │ ├── json │ │ │ └── JsonDateSerializer.java │ │ │ └── config │ │ │ └── WebConfig.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── H2demoApplicationTests.java ├── initial │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── templates │ │ │ │ ├── post │ │ │ │ │ └── readme.md │ │ │ │ └── author │ │ │ │ │ ├── readme.md │ │ │ │ │ └── list.html │ │ │ ├── logback.xml │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── therealdanvega │ │ │ ├── Application.java │ │ │ ├── repository │ │ │ ├── AuthorRepository.java │ │ │ └── PostRepository.java │ │ │ ├── service │ │ │ ├── AuthorService.java │ │ │ └── PostService.java │ │ │ ├── controller │ │ │ ├── HomeController.java │ │ │ └── AuthorController.java │ │ │ ├── json │ │ │ └── JsonDateSerializer.java │ │ │ └── config │ │ │ └── WebConfig.java │ │ └── test │ │ └── java │ │ └── com │ │ └── therealdanvega │ │ └── H2demoApplicationTests.java └── validation │ └── src │ ├── main │ ├── resources │ │ ├── templates │ │ │ ├── post │ │ │ │ └── readme.md │ │ │ └── author │ │ │ │ ├── readme.md │ │ │ │ └── list.html │ │ ├── messages.properties │ │ ├── logback.xml │ │ └── application.properties │ └── java │ │ └── com │ │ └── therealdanvega │ │ ├── Application.java │ │ ├── repository │ │ ├── AuthorRepository.java │ │ └── PostRepository.java │ │ ├── service │ │ └── AuthorService.java │ │ ├── controller │ │ ├── HomeController.java │ │ └── AuthorController.java │ │ ├── json │ │ └── JsonDateSerializer.java │ │ └── config │ │ └── WebConfig.java │ └── test │ └── java │ └── com │ └── therealdanvega │ └── H2demoApplicationTests.java ├── questions └── mvc-controller-action │ └── src │ ├── main │ ├── resources │ │ ├── templates │ │ │ ├── author │ │ │ │ ├── readme.md │ │ │ │ └── list.html │ │ │ └── post │ │ │ │ └── readme.md │ │ ├── application.properties │ │ └── logback.xml │ └── java │ │ └── com │ │ └── therealdanvega │ │ ├── Application.java │ │ ├── repository │ │ ├── AuthorRepository.java │ │ └── PostRepository.java │ │ ├── service │ │ └── AuthorService.java │ │ ├── controller │ │ ├── HomeController.java │ │ └── AuthorController.java │ │ └── json │ │ └── JsonDateSerializer.java │ └── test │ └── java │ └── com │ └── therealdanvega │ └── H2demoApplicationTests.java ├── README.md ├── hello-spring-boot └── helloworld.groovy └── .project /data/advqueries/data/elasticsearch/nodes/0/node.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/jdbcdemo/data/elasticsearch/nodes/0/node.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/mongodemo/data/elasticsearch/nodes/0/node.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/blogrefactor/data/elasticsearch/nodes/0/node.lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/h2demo/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core-spring/beans/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rest/rest-starter/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /rest/rest-template/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /security/blog/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core-spring/auto-configure/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /guides/sending-email/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-applications/starter/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /crud/edit/src/main/resources/templates/post/readme.md: -------------------------------------------------------------------------------- 1 | Post View Templates -------------------------------------------------------------------------------- /crud/read/src/main/resources/templates/post/readme.md: -------------------------------------------------------------------------------- 1 | Post View Templates -------------------------------------------------------------------------------- /guides/sending-email-async/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /security/security-custom/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /security/security-starter/bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-applications/controllers/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web-applications/errors/src/main/resources/static/404.html: -------------------------------------------------------------------------------- 1 | page not found -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core-spring/configuration-properties/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /crud/create/src/main/resources/templates/author/readme.md: -------------------------------------------------------------------------------- 1 | Author View Templates -------------------------------------------------------------------------------- /crud/create/src/main/resources/templates/post/readme.md: -------------------------------------------------------------------------------- 1 | Post View Templates -------------------------------------------------------------------------------- /crud/delete/src/main/resources/templates/author/readme.md: -------------------------------------------------------------------------------- 1 | Author View Templates -------------------------------------------------------------------------------- /crud/delete/src/main/resources/templates/post/readme.md: -------------------------------------------------------------------------------- 1 | Post View Templates -------------------------------------------------------------------------------- /crud/edit/src/main/resources/templates/author/readme.md: -------------------------------------------------------------------------------- 1 | Author View Templates -------------------------------------------------------------------------------- /crud/initial/src/main/resources/templates/post/readme.md: -------------------------------------------------------------------------------- 1 | Post View Templates -------------------------------------------------------------------------------- /crud/read/src/main/resources/templates/author/readme.md: -------------------------------------------------------------------------------- 1 | Author View Templates -------------------------------------------------------------------------------- /crud/validation/src/main/resources/templates/post/readme.md: -------------------------------------------------------------------------------- 1 | Post View Templates -------------------------------------------------------------------------------- /web-applications/controllers/src/main/resources/templates/post.html: -------------------------------------------------------------------------------- 1 | post.html -------------------------------------------------------------------------------- /crud/initial/src/main/resources/templates/author/readme.md: -------------------------------------------------------------------------------- 1 | Author View Templates -------------------------------------------------------------------------------- /crud/validation/src/main/resources/templates/author/readme.md: -------------------------------------------------------------------------------- 1 | Author View Templates -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/outro.js: -------------------------------------------------------------------------------- 1 | })); 2 | -------------------------------------------------------------------------------- /crud/delete/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | NotEmpty.post.title=Title is required. -------------------------------------------------------------------------------- /crud/edit/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | NotEmpty.post.title=Title is required. -------------------------------------------------------------------------------- /crud/validation/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | NotEmpty.post.title=Title is required. -------------------------------------------------------------------------------- /web-applications/bower/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "src/main/resources/static/lib/" 3 | } -------------------------------------------------------------------------------- /web-applications/errors/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false -------------------------------------------------------------------------------- /core-spring/profiles/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=development -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/resources/templates/author/readme.md: -------------------------------------------------------------------------------- 1 | Author View Templates -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/resources/templates/post/readme.md: -------------------------------------------------------------------------------- 1 | Post View Templates -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/resources/templates/_subtemplate.gsp: -------------------------------------------------------------------------------- 1 | Hello from sub template! -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/resources/templates/_template_body.gsp: -------------------------------------------------------------------------------- 1 | This is the body: ${body()} -------------------------------------------------------------------------------- /web-applications/starter/src/main/resources/static/images/readme.md: -------------------------------------------------------------------------------- 1 | place any images in this directory -------------------------------------------------------------------------------- /web-applications/thymeleaf/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | -------------------------------------------------------------------------------- /web-applications/starter/readme.md: -------------------------------------------------------------------------------- 1 | This is a starter project for the developing web applications section. -------------------------------------------------------------------------------- /web-applications/starter/src/main/resources/static/css/readme.md: -------------------------------------------------------------------------------- 1 | place any stylesheets in this directory... -------------------------------------------------------------------------------- /web-applications/starter/src/main/resources/static/js/readme.md: -------------------------------------------------------------------------------- 1 | place any javascript assets in this directory -------------------------------------------------------------------------------- /web-applications/starter/src/main/resources/templates/readme.md: -------------------------------------------------------------------------------- 1 | place all template and layout files here... -------------------------------------------------------------------------------- /core-spring/profiles/src/main/resources/application-development.properties: -------------------------------------------------------------------------------- 1 | msg=Hello from development properties -------------------------------------------------------------------------------- /core-spring/profiles/src/main/resources/application-production.properties: -------------------------------------------------------------------------------- 1 | msg=Hello from production properties -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/selector.js: -------------------------------------------------------------------------------- 1 | define([ "./selector-sizzle" ]); 2 | -------------------------------------------------------------------------------- /web-applications/internationalization/src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | copyright=Copyright Dan Vega 2015 -------------------------------------------------------------------------------- /security/security-custom/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | debug=true 3 | -------------------------------------------------------------------------------- /web-applications/internationalization/src/main/resources/messages_fr.properties: -------------------------------------------------------------------------------- 1 | copyright=Droit d'auteur Dan Vega 2015 -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/js/application.js: -------------------------------------------------------------------------------- 1 | console.log("application.js logging..."); -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/arr.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return []; 3 | }); 4 | -------------------------------------------------------------------------------- /web-applications/internationalization/src/main/resources/messages_es.properties: -------------------------------------------------------------------------------- 1 | copyright=Derechos de autor Dan Vega 2015 -------------------------------------------------------------------------------- /security/security-starter/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #security.user.name=dan 2 | #security.user.password=password -------------------------------------------------------------------------------- /web-applications/internationalization/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.mvc.locale=fr -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/ajax/var/rquery.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\?/); 3 | }); 4 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/rnotwhite.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/\S+/g); 3 | }); 4 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.thymeleaf.cache=false 2 | spring.data.mongodb.database=spring-boot-intro 3 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/var/rmargin.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^margin/); 3 | }); 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot Intro 2 | 3 | This is a repository that will contain all of the code for my Spring Boot Introduction course. 4 | 5 | 6 | -------------------------------------------------------------------------------- /core-spring/external-config/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | pageController: 2 | msg: "Hello from YAML config" 3 | foo: "foo" 4 | bar: "bar" -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/strundefined.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return typeof undefined; 3 | }); 4 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/push.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.push; 5 | }); 6 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/slice.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.slice; 5 | }); 6 | -------------------------------------------------------------------------------- /rest/halbrowser/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/class2type.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // [[Class]] -> type pairs 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/concat.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.concat; 5 | }); 6 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/indexOf.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./arr" 3 | ], function( arr ) { 4 | return arr.indexOf; 5 | }); 6 | -------------------------------------------------------------------------------- /hello-spring-boot/helloworld.groovy: -------------------------------------------------------------------------------- 1 | @RestController 2 | class HelloWorld { 3 | 4 | @RequestMapping("/") 5 | String home(){ 6 | "Hello, World!" 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /rest/rest-starter/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/var/cssExpand.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return [ "Top", "Right", "Bottom", "Left" ]; 3 | }); 4 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/pnum.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; 3 | }); 4 | -------------------------------------------------------------------------------- /rest/rest-error-handling/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/data/var/data_priv.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/data/var/data_user.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../Data" 3 | ], function( Data ) { 4 | return new Data(); 5 | }); 6 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/manipulation/var/rcheckableType.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return (/^(?:checkbox|radio)$/i); 3 | }); 4 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/ajax/var/nonce.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core" 3 | ], function( jQuery ) { 4 | return jQuery.now(); 5 | }); 6 | -------------------------------------------------------------------------------- /data/advqueries/data/elasticsearch/nodes/0/_state/global-2.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/data/advqueries/data/elasticsearch/nodes/0/_state/global-2.st -------------------------------------------------------------------------------- /data/jdbcdemo/data/elasticsearch/nodes/0/_state/global-7.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/data/jdbcdemo/data/elasticsearch/nodes/0/_state/global-7.st -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/resources/templates/layouts/sample.gsp: -------------------------------------------------------------------------------- 1 |
2 | Sample layout - start
3 |
4 | Sample layout - end
5 |
-------------------------------------------------------------------------------- /web-applications/internationalization/.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles=pom.xml 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | spring.thymeleaf.cache=false -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/toString.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./class2type" 3 | ], function( class2type ) { 4 | return class2type.toString; 5 | }); 6 | -------------------------------------------------------------------------------- /data/blogrefactor/data/elasticsearch/nodes/0/_state/global-32.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/data/blogrefactor/data/elasticsearch/nodes/0/_state/global-32.st -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/core/var/rsingleTag.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // Match a standalone tag 3 | return (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); 4 | }); 5 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/hasOwn.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./class2type" 3 | ], function( class2type ) { 4 | return class2type.hasOwnProperty; 5 | }); 6 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/var/support.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | // All support tests are defined in their respective modules. 3 | return {}; 4 | }); 5 | -------------------------------------------------------------------------------- /rest/hypermedia/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | #spring.data.rest.base-path=/api -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/images/tfsbg_2012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/web-applications/bower/src/main/resources/static/images/tfsbg_2012.jpg -------------------------------------------------------------------------------- /data/advqueries/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.platform=h2 2 | 3 | spring.h2.console.enabled=true 4 | spring.h2.console.path=/console 5 | 6 | spring.thymeleaf.cache=false 7 | -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/css/starter-template.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | } 4 | .starter-template { 5 | padding: 40px 15px; 6 | text-align: center; 7 | } -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | spring.thymeleaf.cache=false -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/var/rnumnonpx.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../var/pnum" 3 | ], function( pnum ) { 4 | return new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 5 | }); 6 | -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/images/tfsbg_2012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/web-applications/static-content/src/main/resources/static/images/tfsbg_2012.jpg -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/traversing/var/rneedsContext.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core", 3 | "../../selector" 4 | ], function( jQuery ) { 5 | return jQuery.expr.match.needsContext; 6 | }); 7 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #spring.profiles.active=production 2 | 3 | spring.h2.console.enabled=true 4 | spring.h2.console.path=/console 5 | spring.datasource.platform=h2 6 | spring.thymeleaf.cache=false -------------------------------------------------------------------------------- /rest/rest-template/src/main/resources/static/data/weather.json: -------------------------------------------------------------------------------- 1 | { 2 | "temp" : "60", 3 | "description" : "60 and cloudy", 4 | "location": { 5 | "city": "Cleveland", 6 | "state" : "OH", 7 | "country": "United States" 8 | } 9 | } -------------------------------------------------------------------------------- /security/blog/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=production 2 | 3 | #spring.h2.console.enabled=true 4 | #spring.h2.console.path=/console 5 | #spring.datasource.platform=h2 6 | spring.thymeleaf.cache=false -------------------------------------------------------------------------------- /data/h2demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.name=foodb 2 | #spring.datasource.jdbc-url=jdbc:h2:mem:foodb 3 | 4 | spring.h2.console.enabled=true 5 | spring.h2.console.path=/console 6 | spring.datasource.platform=h2 -------------------------------------------------------------------------------- /core-spring/profiles/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | environments: 2 | development: 3 | url: http://dev.bar.com 4 | name: Developer Setup 5 | production: 6 | url: http://foo.bar.com 7 | name: My Cool App -------------------------------------------------------------------------------- /crud/create/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /crud/delete/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /crud/edit/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /crud/initial/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /crud/read/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /data/h2demo/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/event/support.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../var/support" 3 | ], function( support ) { 4 | 5 | support.focusinBubbles = "onfocusin" in window; 6 | 7 | return support; 8 | 9 | }); 10 | -------------------------------------------------------------------------------- /web-applications/internationalization/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//src/main/java=UTF-8 3 | encoding//src/main/resources=UTF-8 4 | encoding//src/test/java=UTF-8 5 | encoding/=UTF-8 6 | -------------------------------------------------------------------------------- /web-applications/internationalization/.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /crud/validation/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /data/advqueries/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /security/blog/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /guides/sending-email/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host = smtp.gmail.com 2 | spring.mail.username = xxx@gmail.com 3 | spring.mail.password = xxxxxxxxxxxxx 4 | spring.mail.port=587 5 | spring.mail.properties.mail.smtp.starttls.enable = true -------------------------------------------------------------------------------- /web-applications/errors/src/main/resources/static/css/blog.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-top:20px; 3 | } 4 | 5 | header h1 { 6 | font-family: 'Exo', sans-serif; 7 | font-size: 38px; 8 | } 9 | 10 | p, address { 11 | font-family: 'Roboto', sans-serif; 12 | } -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | spring-boot-intro 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /core-spring/external-config/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #pageController.msg=Hello from application.properties 2 | pageController.foo=foo 3 | pageController.bar=bar 4 | 5 | app.name=My Cool APplicaiton 6 | app.description=${app.name} is a Spring Boot Application. -------------------------------------------------------------------------------- /guides/sending-email-async/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.mail.host = smtp.gmail.com 2 | spring.mail.username = username@gmail.com 3 | spring.mail.password = xxxxxxxxxxxxxxxxx 4 | spring.mail.port=587 5 | spring.mail.properties.mail.smtp.starttls.enable = true -------------------------------------------------------------------------------- /core-spring/configuration-properties/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | myconfig: 2 | app-name: My Application Name 3 | app-description: ${myconfig.app-name} is a Spring Boot Application 4 | admin-first-name: Dan 5 | admin-last-name: Vega 6 | adminEmail: danvega@gmail.com -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/resources/templates/layouts/main.gsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | Decorated <g:layoutTitle /> 4 | 5 | 6 | 7 | Decorated before 8 | 9 | Decorated after 10 | 11 | -------------------------------------------------------------------------------- /web-applications/internationalization/src/main/resources/static/css/blog.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-top:20px; 3 | } 4 | 5 | header h1 { 6 | font-family: 'Exo', sans-serif; 7 | font-size: 38px; 8 | } 9 | 10 | p, address { 11 | font-family: 'Roboto', sans-serif; 12 | } -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /web-applications/thymeleaf/src/main/resources/static/css/blog.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-top:20px; 3 | } 4 | 5 | header h1 { 6 | font-family: 'Exo', sans-serif; 7 | font-size: 38px; 8 | } 9 | 10 | p, address { 11 | font-family: 'Roboto', sans-serif; 12 | } -------------------------------------------------------------------------------- /security/security-springdata/src/main/java/com/therealdanvega/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import com.therealdanvega.domain.User; 4 | 5 | public interface UserService { 6 | 7 | public User findByEmail(String email); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danvega/spring-boot-intro/HEAD/web-applications/static-content/src/main/resources/static/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /crud/create/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | spring.thymeleaf.cache=false 6 | 7 | security.user.name=admin 8 | security.user.password=admin 9 | security.user.role=ADMIN 10 | -------------------------------------------------------------------------------- /crud/delete/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | spring.thymeleaf.cache=false 6 | 7 | security.user.name=admin 8 | security.user.password=admin 9 | security.user.role=ADMIN 10 | -------------------------------------------------------------------------------- /crud/edit/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | spring.thymeleaf.cache=false 6 | 7 | security.user.name=admin 8 | security.user.password=admin 9 | security.user.role=ADMIN 10 | -------------------------------------------------------------------------------- /crud/initial/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | spring.thymeleaf.cache=false 6 | 7 | security.user.name=admin 8 | security.user.password=admin 9 | security.user.role=ADMIN 10 | -------------------------------------------------------------------------------- /crud/read/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | spring.thymeleaf.cache=false 6 | 7 | security.user.name=admin 8 | security.user.password=admin 9 | security.user.role=ADMIN 10 | -------------------------------------------------------------------------------- /web-applications/starter/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Toys for Shots 5 | 6 | 7 |

Toys for Shots

8 |

Welcome to www.toysforshots.com

9 | 10 | -------------------------------------------------------------------------------- /crud/validation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/console 3 | spring.datasource.platform=h2 4 | 5 | spring.thymeleaf.cache=false 6 | 7 | security.user.name=admin 8 | security.user.password=admin 9 | security.user.role=ADMIN 10 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/resources/static/css/blog.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-top:20px; 3 | } 4 | 5 | header h1 { 6 | font-family: 'Exo', sans-serif; 7 | font-size: 38px; 8 | } 9 | 10 | p, address, section { 11 | font-family: 'Roboto', sans-serif; 12 | } 13 | 14 | address { 15 | margin-top:20px; 16 | } -------------------------------------------------------------------------------- /data/mongodemo/src/main/resources/static/css/blog.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-top:20px; 3 | } 4 | 5 | header h1 { 6 | font-family: 'Exo', sans-serif; 7 | font-size: 38px; 8 | } 9 | 10 | p, address, section { 11 | font-family: 'Roboto', sans-serif; 12 | } 13 | 14 | address { 15 | margin-top:20px; 16 | } -------------------------------------------------------------------------------- /security/blog/src/main/resources/static/css/blog.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-top:20px; 3 | } 4 | 5 | header h1 { 6 | font-family: 'Exo', sans-serif; 7 | font-size: 38px; 8 | } 9 | 10 | p, address, section { 11 | font-family: 'Roboto', sans-serif; 12 | } 13 | 14 | address { 15 | margin-top:20px; 16 | } -------------------------------------------------------------------------------- /data/blogrefactor/src/main/resources/static/css/blog.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | margin-top:20px; 3 | } 4 | 5 | header h1 { 6 | font-family: 'Exo', sans-serif; 7 | font-size: 38px; 8 | } 9 | 10 | p, address, section { 11 | font-family: 'Roboto', sans-serif; 12 | } 13 | 14 | address { 15 | margin-top:20px; 16 | } -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/attributes.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./attributes/attr", 4 | "./attributes/prop", 5 | "./attributes/classes", 6 | "./attributes/val" 7 | ], function( jQuery ) { 8 | 9 | // Return jQuery for attributes-only inclusion 10 | return jQuery; 11 | }); 12 | -------------------------------------------------------------------------------- /web-applications/internationalization/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 3 | org.eclipse.jdt.core.compiler.compliance=1.8 4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 5 | org.eclipse.jdt.core.compiler.source=1.8 6 | -------------------------------------------------------------------------------- /data/h2demo/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /security/blog/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /data/advqueries/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /rest/halbrowser/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /rest/rest-starter/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /rest/rest-error-handling/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /security/security-custom/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Security Demo - Home Page 6 | 7 | 8 | 9 |
10 | 11 |

Home Page

12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /security/security-springdata/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | Security Demo - Home Page 6 | 7 | 8 | 9 |
10 | 11 |

Home Page

12 | 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/deprecated.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./traversing" 4 | ], function( jQuery ) { 5 | 6 | // The number of elements contained in the matched element set 7 | jQuery.fn.size = function() { 8 | return this.length; 9 | }; 10 | 11 | jQuery.fn.andSelf = jQuery.fn.addBack; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /rest/hypermedia/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.PagingAndSortingRepository; 4 | 5 | import com.therealdanvega.domain.Author; 6 | 7 | public interface AuthorRepository extends PagingAndSortingRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/ajax/parseJSON.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Support: Android 2.3 6 | // Workaround failure to string-cast null input 7 | jQuery.parseJSON = function( data ) { 8 | return JSON.parse( data + "" ); 9 | }; 10 | 11 | return jQuery.parseJSON; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background: #0999ce url('../images/tfsbg_2012.jpg') no-repeat; 3 | background-size:100%; 4 | color:#000; 5 | font-size:12px; 6 | line-height:180%; 7 | margin:10px; 8 | } 9 | 10 | .intro { 11 | background-color: #fff; 12 | opacity: .9; 13 | padding:20px; 14 | } -------------------------------------------------------------------------------- /rest/hypermedia/src/main/java/com/therealdanvega/domain/Teaser.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | import org.springframework.data.rest.core.config.Projection; 4 | 5 | @Projection( name="teaser", types = {Post.class} ) 6 | public interface Teaser { 7 | 8 | String getTitle(); 9 | 10 | String getSlug(); 11 | 12 | String getTeaser(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/effects/animatedSelector.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector", 4 | "../effects" 5 | ], function( jQuery ) { 6 | 7 | jQuery.expr.filters.animated = function( elem ) { 8 | return jQuery.grep(jQuery.timers, function( fn ) { 9 | return elem === fn.elem; 10 | }).length; 11 | }; 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /rest/halbrowser/src/main/java/com/therealdanvega/domain/Teaser.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | import org.springframework.data.rest.core.config.Projection; 4 | 5 | @Projection( name="teaser", types = {Post.class} ) 6 | public interface Teaser { 7 | 8 | String getTitle(); 9 | 10 | String getSlug(); 11 | 12 | String getTeaser(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /rest/rest-error-handling/src/main/java/com/therealdanvega/exception/PostNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.exception; 2 | 3 | public class PostNotFoundException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = -1226439803994500725L; 6 | 7 | public PostNotFoundException(String msg){ 8 | super(msg); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/css/style.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background: #0999ce url('../images/tfsbg_2012.jpg') no-repeat; 3 | background-size:100%; 4 | color:#000; 5 | font-size:12px; 6 | line-height:180%; 7 | margin:10px; 8 | } 9 | 10 | .intro { 11 | background-color: #fff; 12 | opacity: .9; 13 | padding:20px; 14 | } -------------------------------------------------------------------------------- /data/mongodemo/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.math.BigInteger; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /security/security-springdata/src/main/java/com/therealdanvega/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.therealdanvega.domain.User; 6 | 7 | public interface UserRepository extends CrudRepository { 8 | 9 | User findByEmail(String email); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /rest/rest-starter/src/main/java/com/therealdanvega/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import com.therealdanvega.domain.Post; 4 | 5 | public interface PostService { 6 | 7 | Iterable list(); 8 | 9 | Post create(Post post); 10 | 11 | Post read(long id); 12 | 13 | Post update(long id, Post post); 14 | 15 | void delete(long id); 16 | } 17 | -------------------------------------------------------------------------------- /rest/rest-error-handling/src/main/java/com/therealdanvega/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import com.therealdanvega.domain.Post; 4 | 5 | public interface PostService { 6 | 7 | Iterable list(); 8 | 9 | Post create(Post post); 10 | 11 | Post read(long id); 12 | 13 | Post update(long id, Post post); 14 | 15 | void delete(long id); 16 | } 17 | -------------------------------------------------------------------------------- /data/h2demo/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import com.therealdanvega.domain.Post; 7 | 8 | @Repository 9 | public interface PostRepository extends CrudRepository { 10 | 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/manipulation/_evalUrl.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../ajax" 3 | ], function( jQuery ) { 4 | 5 | jQuery._evalUrl = function( url ) { 6 | return jQuery.ajax({ 7 | url: url, 8 | type: "GET", 9 | dataType: "script", 10 | async: false, 11 | global: false, 12 | "throws": true 13 | }); 14 | }; 15 | 16 | return jQuery._evalUrl; 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /security/security-custom/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class HomeController { 8 | 9 | @RequestMapping("/") 10 | public String home(){ 11 | return "index"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /security/security-springdata/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class HomeController { 8 | 9 | @RequestMapping("/") 10 | public String home(){ 11 | return "index"; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | List findAllByOrderByLastNameAscFirstNameAsc(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | List findAllByOrderByLastNameAscFirstNameAsc(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | List findAllByOrderByLastNameAscFirstNameAsc(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | List findAllByOrderByLastNameAscFirstNameAsc(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | List findAllByOrderByLastNameAscFirstNameAsc(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | List findAllByOrderByLastNameAscFirstNameAsc(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /data/advqueries/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/selector-sizzle.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "sizzle" 4 | ], function( jQuery, Sizzle ) { 5 | 6 | jQuery.find = Sizzle; 7 | jQuery.expr = Sizzle.selectors; 8 | jQuery.expr[":"] = jQuery.expr.pseudos; 9 | jQuery.unique = Sizzle.uniqueSort; 10 | jQuery.text = Sizzle.getText; 11 | jQuery.isXMLDoc = Sizzle.isXML; 12 | jQuery.contains = Sizzle.contains; 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/java/com/toysforshots/taglib/FormatTagLib.groovy: -------------------------------------------------------------------------------- 1 | package com.toysforshots.taglib 2 | 3 | import grails.gsp.TagLib 4 | import org.springframework.stereotype.Component 5 | 6 | import java.text.SimpleDateFormat; 7 | 8 | @Component 9 | @TagLib 10 | class FormatTagLib { 11 | 12 | def dateFormat = { attrs, body -> 13 | out << new SimpleDateFormat(attrs.format).format(attrs.date) 14 | } 15 | } -------------------------------------------------------------------------------- /data/blogrefactor/src/main/java/com/therealdanvega/BlogApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BlogApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BlogApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/java/com/therealdanvega/Application.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/java/com/therealdanvega/repository/AuthorRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.therealdanvega.domain.Author; 8 | 9 | public interface AuthorRepository extends CrudRepository { 10 | 11 | List findAllByOrderByLastNameAscFirstNameAsc(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /security/blog/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | @RequestMapping("/authors") 8 | public class AuthorController { 9 | 10 | @RequestMapping("/list") 11 | public String list(){ 12 | return "author/list"; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | @RequestMapping("/authors") 8 | public class AuthorController { 9 | 10 | @RequestMapping("/list") 11 | public String list(){ 12 | return "author/list"; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/java/com/therealdanvega/MongoDBApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class MongoDBApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(MongoDBApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /security/security-springdata/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Thymeleaf 2 | spring.thymeleaf.cache=false 3 | 4 | # mysql connection details 5 | spring.datasource.url=jdbc:mysql://localhost/spring-boot-intro 6 | spring.datasource.username=springboot 7 | spring.datasource.password=springboot 8 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 9 | 10 | # create-drop | update | validate | none 11 | spring.jpa.hibernate.ddl-auto=update -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/event/ajax.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../event" 4 | ], function( jQuery ) { 5 | 6 | // Attach a bunch of functions for handling common AJAX events 7 | jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { 8 | jQuery.fn[ type ] = function( fn ) { 9 | return this.on( type, fn ); 10 | }; 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/java/com/therealdanvega/JDBCDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class JDBCDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(JDBCDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /web-applications/thymeleaf/src/main/java/com/toysforshots/ThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ThymeleafApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ThymeleafApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /guides/sending-email/src/main/java/com/therealdanvega/SendingEmailApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SendingEmailApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SendingEmailApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/java/com/toysforshots/ToysforshotsApplication.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ToysforshotsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ToysforshotsApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/java/com/toysforshots/ToysforshotsApplication.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ToysforshotsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ToysforshotsApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web-applications/starter/src/main/java/com/toysforshots/ToysforshotsApplication.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ToysforshotsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ToysforshotsApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /security/blog/src/main/java/com/therealdanvega/SecurityDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SecurityDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SecurityDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /web-applications/controllers/src/main/java/com/therealdanvega/ControllersApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ControllersApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ControllersApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /rest/rest-template/src/main/java/com/therealdanvega/RestTemplateApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class RestTemplateApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(RestTemplateApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /security/security-custom/src/main/java/com/therealdanvega/SecurityCustomApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SecurityCustomApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SecurityCustomApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web-applications/static-content/src/main/java/com/toysforshots/ToysforshotsApplication.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ToysforshotsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ToysforshotsApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core-spring/external-config/src/main/java/com/therealdanvega/ExternalConfigApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ExternalConfigApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ExternalConfigApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /security/security-springdata/src/main/java/com/therealdanvega/SecurityCustomApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SecurityCustomApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SecurityCustomApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /security/security-starter/src/main/java/com/therealdanvega/SecurityStarterApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SecurityStarterApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SecurityStarterApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/var/isHidden.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../../core", 3 | "../../selector" 4 | // css is assumed 5 | ], function( jQuery ) { 6 | 7 | return function( elem, el ) { 8 | // isHidden might be called from jQuery#filter function; 9 | // in that case, element will be second argument 10 | elem = el || elem; 11 | return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); 12 | }; 13 | }); 14 | -------------------------------------------------------------------------------- /rest/halbrowser/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.data.repository.query.Param; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | public interface PostRepository extends CrudRepository { 11 | 12 | List findByAuthorFirstName(@Param("firstName") String firstName); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /web-applications/internationalization/src/main/java/com/therealdanvega/InternationalizationApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class InternationalizationApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(InternationalizationApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /web-applications/internationalization/src/main/java/com/therealdanvega/controller/PostController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @Controller 8 | @RequestMapping("/posts") 9 | public class PostController { 10 | 11 | @RequestMapping("/") 12 | public String list(){ 13 | return "views/list"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /rest/hypermedia/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.PagingAndSortingRepository; 6 | import org.springframework.data.repository.query.Param; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | public interface PostRepository extends PagingAndSortingRepository { 11 | 12 | List findByTitleContaining(@Param("title") String title); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /web-applications/gspdemo/src/main/java/com/toysforshots/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @Controller 8 | public class HomeController { 9 | 10 | @RequestMapping("/") 11 | public String home(Model model){ 12 | model.addAttribute("name","Dan"); 13 | return "index"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/resources/schema-h2.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS Author; 2 | 3 | CREATE TABLE Author ( 4 | id bigint NOT NULL, 5 | first_name varchar(100), 6 | last_name varchar(100), 7 | email varchar(100), 8 | PRIMARY KEY (id) 9 | ); 10 | 11 | DROP TABLE IF EXISTS Post; 12 | 13 | CREATE TABLE Post ( 14 | id bigint NOT NULL, 15 | title varchar(100), 16 | slug varchar(100), 17 | teaser varchar(4000), 18 | body varchar(4000), 19 | posted_on TIMESTAMP, 20 | author_id bigint, 21 | PRIMARY KEY (id) 22 | ); 23 | 24 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/hiddenVisibleSelectors.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../selector" 4 | ], function( jQuery ) { 5 | 6 | jQuery.expr.filters.hidden = function( elem ) { 7 | // Support: Opera <= 12.12 8 | // Opera reports offsetWidths and offsetHeights less than zero on some elements 9 | return elem.offsetWidth <= 0 && elem.offsetHeight <= 0; 10 | }; 11 | jQuery.expr.filters.visible = function( elem ) { 12 | return !jQuery.expr.filters.hidden( elem ); 13 | }; 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /core-spring/beans/src/main/java/com/abc/foo/NotificationService.java: -------------------------------------------------------------------------------- 1 | package com.abc.foo; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class NotificationService { 7 | 8 | public NotificationService(){ 9 | 10 | } 11 | 12 | public void send(){ 13 | // do something 14 | } 15 | 16 | public void sendAsync(){ 17 | // do something 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return "NotificationService{}"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.math.BigInteger; 4 | import java.util.List; 5 | 6 | import org.springframework.data.repository.CrudRepository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | public interface PostRepository extends CrudRepository { 11 | 12 | Post findFirstByOrderByPostedOnDesc(); 13 | 14 | List findAllByOrderByPostedOnDesc(); 15 | 16 | Post findBySlug(String slug); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /security/blog/src/main/resources/application-production.properties: -------------------------------------------------------------------------------- 1 | # production profile 2 | spring.datasource.url=jdbc:sqlserver://xe5h75qrc6.database.windows.net:1433;database=spring-boot-intro;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30; 3 | spring.datasource.username=dvega 4 | spring.datasource.password=Cl3v3land01 5 | spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver 6 | 7 | # none | validate | update | create-drop 8 | spring.jpa.hibernate.ddl-auto=create-drop -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/var/getStyles.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | return function( elem ) { 3 | // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 4 | // IE throws on elements created in popups 5 | // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 6 | if ( elem.ownerDocument.defaultView.opener ) { 7 | return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); 8 | } 9 | 10 | return window.getComputedStyle( elem, null ); 11 | }; 12 | }); 13 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/data/accepts.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | /** 6 | * Determines whether an object can have data 7 | */ 8 | jQuery.acceptData = function( owner ) { 9 | // Accepts only: 10 | // - Node 11 | // - Node.ELEMENT_NODE 12 | // - Node.DOCUMENT_NODE 13 | // - Object 14 | // - Any 15 | /* jshint -W018 */ 16 | return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 17 | }; 18 | 19 | return jQuery.acceptData; 20 | }); 21 | -------------------------------------------------------------------------------- /data/advqueries/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:com.therealdanvega.Application 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /web-applications/bower/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bower-demo", 3 | "homepage": "https://github.com/cfaddict/spring-boot-intro", 4 | "authors": [ 5 | "Dan Vega " 6 | ], 7 | "description": "bower demo app", 8 | "main": "", 9 | "moduleType": [], 10 | "license": "MIT", 11 | "ignore": [ 12 | "**/.*", 13 | "node_modules", 14 | "bower_components", 15 | "src/main/resources/static/lib/", 16 | "test", 17 | "tests" 18 | ], 19 | "dependencies": { 20 | "jquery": "~2.1.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /data/blogrefactor/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:com.therealdanvega.BlogApplication 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /data/jdbcdemo/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:com.therealdanvega.JDBCDemoApplication 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /data/mongodemo/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:com.therealdanvega.MongoDBApplication 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /guides/sending-email-async/src/main/java/com/therealdanvega/SendingEmailAsyncApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableAsync; 6 | 7 | @SpringBootApplication 8 | @EnableAsync 9 | public class SendingEmailAsyncApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SendingEmailAsyncApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rest/hypermedia/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:com.therealdanvega.HypermediaApplication 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /security/blog/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:com.therealdanvega.SecurityDemoApplication 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /security/security-custom/src/main/java/com/therealdanvega/controller/PostController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class PostController { 8 | 9 | @RequestMapping("/posts/") 10 | public String list(){ 11 | return "list posts..."; 12 | } 13 | 14 | @RequestMapping("/admin/posts/create") 15 | public String addPost(){ 16 | return "add posts..."; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /security/security-springdata/src/main/java/com/therealdanvega/controller/PostController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class PostController { 8 | 9 | @RequestMapping("/posts/") 10 | public String list(){ 11 | return "list posts..."; 12 | } 13 | 14 | @RequestMapping("/admin/posts/create") 15 | public String addPost(){ 16 | return "add posts..."; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /rest/rest-error-handling/.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | java:com.therealdanvega.RestErrorHandlingApplication 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /rest/rest-starter/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /rest/rest-error-handling/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /web-applications/controllers/src/main/java/com/therealdanvega/controller/ExceptionControllerAdvice.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.ui.Model; 4 | import org.springframework.web.bind.annotation.ControllerAdvice; 5 | import org.springframework.web.bind.annotation.ExceptionHandler; 6 | 7 | @ControllerAdvice 8 | public class ExceptionControllerAdvice { 9 | 10 | @ExceptionHandler(Exception.class) 11 | public String exception(Exception exception, Model model){ 12 | model.addAttribute("exception", exception); 13 | return "errorHandler"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /web-applications/static-content/src/main/resources/static/lib/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /core-spring/profiles/src/main/java/com/therealdanvega/ProfileDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.context.ApplicationContext; 6 | 7 | @SpringBootApplication 8 | public class ProfileDemoApplication { 9 | 10 | public static void main(String[] args) { 11 | ApplicationContext ctx = SpringApplication.run(ProfileDemoApplication.class, args); 12 | 13 | System.out.println(ctx.getBean("datasource").toString()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /core-spring/profiles/src/main/java/com/therealdanvega/PageController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class PageController { 9 | 10 | @Value("${spring.profiles.active}") 11 | private String environment; 12 | 13 | @Value("${msg}") 14 | private String msg; 15 | 16 | @RequestMapping("/") 17 | public String home(){ 18 | return msg; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | List findAllByAuthorIdOrderByPostedOnDesc(Long id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | List findAllByAuthorIdOrderByPostedOnDesc(Long id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | List findAllByAuthorIdOrderByPostedOnDesc(Long id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud/edit/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | List findAllByAuthorIdOrderByPostedOnDesc(Long id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud/read/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /crud/create/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /crud/delete/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | List findAllByAuthorIdOrderByPostedOnDesc(Long id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud/initial/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | List findAllByAuthorIdOrderByPostedOnDesc(Long id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /crud/validation/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /data/advqueries/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /security/blog/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | /* 14 | * I will return the last post that was created. 15 | */ 16 | Post findFirstByOrderByPostedOnDesc(); 17 | 18 | List findAllByOrderByPostedOnDesc(); 19 | 20 | Post findBySlug(String slug); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /core-spring/external-config/src/main/java/com/therealdanvega/PageController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class PageController { 9 | 10 | @Value("${pageController.msg}") 11 | private String pageControllerMsg; 12 | 13 | @Value("${my.secret}") 14 | private String mySecret; 15 | 16 | @RequestMapping("/") 17 | public String home(){ 18 | return mySecret; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | /* 14 | * I will return the last post that was created. 15 | */ 16 | Post findFirstByOrderByPostedOnDesc(); 17 | 18 | List findAllByOrderByPostedOnDesc(); 19 | 20 | Post findBySlug(String slug); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /data/h2demo/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = H2demoApplication.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /data/blogrefactor/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = BlogApplication.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = JDBCDemoApplication.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /data/mongodemo/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = MongoDBApplication.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /security/blog/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = SecurityDemoApplication.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/java/com/therealdanvega/repository/PostRepository.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.therealdanvega.domain.Post; 9 | 10 | @Repository 11 | public interface PostRepository extends CrudRepository { 12 | 13 | Post findFirstByOrderByPostedOnDesc(); 14 | 15 | List findAllByOrderByPostedOnDesc(); 16 | 17 | Post findBySlug(String slug); 18 | 19 | List findAllByAuthorIdOrderByPostedOnDesc(Long id); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /web-applications/errors/src/test/java/com/therealdanvega/ErrorsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ErrorsApplication.class) 11 | @WebAppConfiguration 12 | public class ErrorsApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/test/java/com/therealdanvega/H2demoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = Application.class) 11 | @WebAppConfiguration 12 | public class H2demoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rest/halbrowser/src/test/java/com/therealdanvega/RestStarterApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = HypermediaApplication.class) 11 | @WebAppConfiguration 12 | public class RestStarterApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rest/hypermedia/src/test/java/com/therealdanvega/RestStarterApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = HypermediaApplication.class) 11 | @WebAppConfiguration 12 | public class RestStarterApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /core-spring/beans/src/test/java/com/therealdanvega/SpringBeansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = SpringBeansApplication.class) 11 | @WebAppConfiguration 12 | public class SpringBeansApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rest/rest-starter/src/test/java/com/therealdanvega/RestStarterApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = RestStarterApplication.class) 11 | @WebAppConfiguration 12 | public class RestStarterApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /web-applications/errors/src/main/java/com/therealdanvega/controller/ExceptionControllerAdvice.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.stereotype.Component; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.ControllerAdvice; 6 | import org.springframework.web.bind.annotation.ExceptionHandler; 7 | 8 | @ControllerAdvice 9 | public class ExceptionControllerAdvice { 10 | 11 | @ExceptionHandler(Exception.class) 12 | public String exception(Exception exception, Model model){ 13 | model.addAttribute("exception", exception); 14 | return "globalControllerHandler"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /web-applications/thymeleaf/src/test/java/com/toysforshots/ThymeleafApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ThymeleafApplication.class) 11 | @WebAppConfiguration 12 | public class ThymeleafApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /core-spring/profiles/src/test/java/com/therealdanvega/ProfileDemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ProfileDemoApplication.class) 11 | @WebAppConfiguration 12 | public class ProfileDemoApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /guides/sending-email/src/test/java/com/therealdanvega/SendingEmailApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = SendingEmailApplication.class) 11 | @WebAppConfiguration 12 | public class SendingEmailApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rest/rest-template/src/test/java/com/therealdanvega/RestTemplateApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = RestTemplateApplication.class) 11 | @WebAppConfiguration 12 | public class RestTemplateApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /web-applications/bower/src/test/java/com/toysforshots/ToysforshotsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ToysforshotsApplication.class) 11 | @WebAppConfiguration 12 | public class ToysforshotsApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /web-applications/gspdemo/src/test/java/com/toysforshots/ToysforshotsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ToysforshotsApplication.class) 11 | @WebAppConfiguration 12 | public class ToysforshotsApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /web-applications/starter/src/test/java/com/toysforshots/ToysforshotsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ToysforshotsApplication.class) 11 | @WebAppConfiguration 12 | public class ToysforshotsApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /web-applications/controllers/src/test/java/com/therealdanvega/ControllersApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ControllersApplication.class) 11 | @WebAppConfiguration 12 | public class ControllersApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /core-spring/auto-configure/src/test/java/com/therealdanvega/AutoConfigureApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = AutoConfigureApplication.class) 11 | @WebAppConfiguration 12 | public class AutoConfigureApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rest/rest-error-handling/src/test/java/com/therealdanvega/RestStarterApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = RestErrorHandlingApplication.class) 11 | @WebAppConfiguration 12 | public class RestStarterApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /security/security-custom/src/test/java/com/therealdanvega/SecurityCustomApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = SecurityCustomApplication.class) 11 | @WebAppConfiguration 12 | public class SecurityCustomApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/addGetHookIf.js: -------------------------------------------------------------------------------- 1 | define(function() { 2 | 3 | function addGetHookIf( conditionFn, hookFn ) { 4 | // Define the hook, we'll check on the first run if it's really needed. 5 | return { 6 | get: function() { 7 | if ( conditionFn() ) { 8 | // Hook not needed (or it's not possible to use it due 9 | // to missing dependency), remove it. 10 | delete this.get; 11 | return; 12 | } 13 | 14 | // Hook needed; redefine it so that the support test is not executed again. 15 | return (this.get = hookFn).apply( this, arguments ); 16 | } 17 | }; 18 | } 19 | 20 | return addGetHookIf; 21 | 22 | }); 23 | -------------------------------------------------------------------------------- /web-applications/static-content/src/test/java/com/toysforshots/ToysforshotsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.toysforshots; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ToysforshotsApplication.class) 11 | @WebAppConfiguration 12 | public class ToysforshotsApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /core-spring/configuration-properties/src/test/java/com/therealdanvega/ConfigpropsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ConfigpropsApplication.class) 11 | @WebAppConfiguration 12 | public class ConfigpropsApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /core-spring/external-config/src/test/java/com/therealdanvega/ExternalConfigApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = ExternalConfigApplication.class) 11 | @WebAppConfiguration 12 | public class ExternalConfigApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /security/security-springdata/src/test/java/com/therealdanvega/SecurityCustomApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = SecurityCustomApplication.class) 11 | @WebAppConfiguration 12 | public class SecurityCustomApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /security/security-starter/src/test/java/com/therealdanvega/SecurityStarterApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = SecurityStarterApplication.class) 11 | @WebAppConfiguration 12 | public class SecurityStarterApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/ajax/parseXML.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // Cross-browser xml parsing 6 | jQuery.parseXML = function( data ) { 7 | var xml, tmp; 8 | if ( !data || typeof data !== "string" ) { 9 | return null; 10 | } 11 | 12 | // Support: IE9 13 | try { 14 | tmp = new DOMParser(); 15 | xml = tmp.parseFromString( data, "text/xml" ); 16 | } catch ( e ) { 17 | xml = undefined; 18 | } 19 | 20 | if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 21 | jQuery.error( "Invalid XML: " + data ); 22 | } 23 | return xml; 24 | }; 25 | 26 | return jQuery.parseXML; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /guides/sending-email-async/src/test/java/com/therealdanvega/SendingEmailAsyncApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = SendingEmailAsyncApplication.class) 11 | @WebAppConfiguration 12 | public class SendingEmailAsyncApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rest/rest-template/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import org.springframework.web.client.RestTemplate; 6 | 7 | import com.therealdanvega.domain.Weather; 8 | 9 | @RestController 10 | public class HomeController { 11 | 12 | @RequestMapping("/") 13 | public Weather home(){ 14 | RestTemplate restTemplate = new RestTemplate(); 15 | Weather weather = restTemplate.getForObject("http://localhost:8080/data/weather.json", Weather.class); 16 | return weather; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /web-applications/internationalization/src/test/java/com/therealdanvega/InternationalizationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.test.context.web.WebAppConfiguration; 6 | import org.springframework.boot.test.SpringApplicationConfiguration; 7 | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; 8 | 9 | @RunWith(SpringJUnit4ClassRunner.class) 10 | @SpringApplicationConfiguration(classes = InternationalizationApplication.class) 11 | @WebAppConfiguration 12 | public class InternationalizationApplicationTests { 13 | 14 | @Test 15 | public void contextLoads() { 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /core-spring/auto-configure/src/main/java/com/therealdanvega/AutoConfigureApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.annotation.ComponentScan; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | @Configuration 10 | @EnableAutoConfiguration 11 | @ComponentScan 12 | public class AutoConfigureApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(AutoConfigureApplication.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /core-spring/profiles/src/main/java/com/therealdanvega/DataSourceConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.context.annotation.Profile; 6 | 7 | @Configuration 8 | public class DataSourceConfig { 9 | 10 | @Bean(name = "datasource") 11 | @Profile("development") 12 | DataSource development(){ 13 | return new DataSource("my-development-url",9999); 14 | } 15 | 16 | @Bean(name = "datasource") 17 | @Profile("production") 18 | DataSource production(){ 19 | return new DataSource("my-production-url",9999); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/queue/delay.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../queue", 4 | "../effects" // Delay is optional because of this dependency 5 | ], function( jQuery ) { 6 | 7 | // Based off of the plugin by Clint Helfers, with permission. 8 | // http://blindsignals.com/index.php/2009/07/jquery-delay/ 9 | jQuery.fn.delay = function( time, type ) { 10 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 11 | type = type || "fx"; 12 | 13 | return this.queue( type, function( next, hooks ) { 14 | var timeout = setTimeout( next, time ); 15 | hooks.stop = function() { 16 | clearTimeout( timeout ); 17 | }; 18 | }); 19 | }; 20 | 21 | return jQuery.fn.delay; 22 | }); 23 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/css/swap.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core" 3 | ], function( jQuery ) { 4 | 5 | // A method for quickly swapping in/out CSS properties to get correct calculations. 6 | jQuery.swap = function( elem, options, callback, args ) { 7 | var ret, name, 8 | old = {}; 9 | 10 | // Remember the old values, and insert the new ones 11 | for ( name in options ) { 12 | old[ name ] = elem.style[ name ]; 13 | elem.style[ name ] = options[ name ]; 14 | } 15 | 16 | ret = callback.apply( elem, args || [] ); 17 | 18 | // Revert the old values 19 | for ( name in options ) { 20 | elem.style[ name ] = old[ name ]; 21 | } 22 | 23 | return ret; 24 | }; 25 | 26 | return jQuery.swap; 27 | 28 | }); 29 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Service 12 | public class AuthorService { 13 | 14 | private AuthorRepository authorRepository; 15 | 16 | @Autowired 17 | public AuthorService(AuthorRepository authorRepository) { 18 | super(); 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | public List list() { 23 | return authorRepository.findAllByOrderByLastNameAscFirstNameAsc(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Service 12 | public class AuthorService { 13 | 14 | private AuthorRepository authorRepository; 15 | 16 | @Autowired 17 | public AuthorService(AuthorRepository authorRepository) { 18 | super(); 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | public List list() { 23 | return authorRepository.findAllByOrderByLastNameAscFirstNameAsc(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Service 12 | public class AuthorService { 13 | 14 | private AuthorRepository authorRepository; 15 | 16 | @Autowired 17 | public AuthorService(AuthorRepository authorRepository) { 18 | super(); 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | public List list() { 23 | return authorRepository.findAllByOrderByLastNameAscFirstNameAsc(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Service 12 | public class AuthorService { 13 | 14 | private AuthorRepository authorRepository; 15 | 16 | @Autowired 17 | public AuthorService(AuthorRepository authorRepository) { 18 | super(); 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | public List list() { 23 | return authorRepository.findAllByOrderByLastNameAscFirstNameAsc(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Service 12 | public class AuthorService { 13 | 14 | private AuthorRepository authorRepository; 15 | 16 | @Autowired 17 | public AuthorService(AuthorRepository authorRepository) { 18 | super(); 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | public List list() { 23 | return authorRepository.findAllByOrderByLastNameAscFirstNameAsc(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Service 12 | public class AuthorService { 13 | 14 | private AuthorRepository authorRepository; 15 | 16 | @Autowired 17 | public AuthorService(AuthorRepository authorRepository) { 18 | super(); 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | public List list() { 23 | return authorRepository.findAllByOrderByLastNameAscFirstNameAsc(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/java/com/therealdanvega/service/AuthorService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Service 12 | public class AuthorService { 13 | 14 | private AuthorRepository authorRepository; 15 | 16 | @Autowired 17 | public AuthorService(AuthorRepository authorRepository) { 18 | super(); 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | public List list() { 23 | return authorRepository.findAllByOrderByLastNameAscFirstNameAsc(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /security/security-custom/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 7 | 8 | @Configuration 9 | public class WebConfig extends WebMvcConfigurerAdapter { 10 | 11 | @Override 12 | public void addViewControllers(ViewControllerRegistry registry) { 13 | super.addViewControllers(registry); 14 | registry.addViewController("/login").setViewName("auth/login"); 15 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 16 | } 17 | 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @Controller 12 | @RequestMapping("/authors") 13 | public class AuthorController { 14 | 15 | @Autowired 16 | AuthorRepository authorRepository; 17 | 18 | @RequestMapping("/list") 19 | @ResponseBody 20 | public Iterable list(){ 21 | return authorRepository.findAll(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /security/security-springdata/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 7 | 8 | @Configuration 9 | public class WebConfig extends WebMvcConfigurerAdapter { 10 | 11 | @Override 12 | public void addViewControllers(ViewControllerRegistry registry) { 13 | super.addViewControllers(registry); 14 | registry.addViewController("/login").setViewName("auth/login"); 15 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 16 | } 17 | 18 | 19 | 20 | } 21 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.PostService; 9 | 10 | @Controller 11 | public class HomeController { 12 | 13 | private PostService postService; 14 | 15 | @Autowired 16 | public HomeController(PostService postService){ 17 | this.postService = postService; 18 | } 19 | 20 | @RequestMapping("/") 21 | public String home(Model model){ 22 | model.addAttribute("post", postService.getLatestPost()); 23 | return "index"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.PostService; 9 | 10 | @Controller 11 | public class HomeController { 12 | 13 | private PostService postService; 14 | 15 | @Autowired 16 | public HomeController(PostService postService){ 17 | this.postService = postService; 18 | } 19 | 20 | @RequestMapping("/") 21 | public String home(Model model){ 22 | model.addAttribute("post", postService.getLatestPost()); 23 | return "index"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.PostService; 9 | 10 | @Controller 11 | public class HomeController { 12 | 13 | private PostService postService; 14 | 15 | @Autowired 16 | public HomeController(PostService postService){ 17 | this.postService = postService; 18 | } 19 | 20 | @RequestMapping("/") 21 | public String home(Model model){ 22 | model.addAttribute("post", postService.getLatestPost()); 23 | return "index"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.PostService; 9 | 10 | @Controller 11 | public class HomeController { 12 | 13 | private PostService postService; 14 | 15 | @Autowired 16 | public HomeController(PostService postService){ 17 | this.postService = postService; 18 | } 19 | 20 | @RequestMapping("/") 21 | public String home(Model model){ 22 | model.addAttribute("post", postService.getLatestPost()); 23 | return "index"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core-spring/beans/src/main/java/com/therealdanvega/PageController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import com.abc.foo.NotificationService; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @RestController 9 | public class PageController { 10 | 11 | // notificationService 12 | private NotificationService notificationService; 13 | 14 | @Autowired 15 | public PageController(NotificationService notificationService) { 16 | this.notificationService = notificationService; 17 | } 18 | 19 | @RequestMapping("/") 20 | public String home(){ 21 | return notificationService.toString(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.PostService; 9 | 10 | @Controller 11 | public class HomeController { 12 | 13 | private PostService postService; 14 | 15 | @Autowired 16 | public HomeController(PostService postService){ 17 | this.postService = postService; 18 | } 19 | 20 | @RequestMapping("/") 21 | public String home(Model model){ 22 | model.addAttribute("post", postService.getLatestPost()); 23 | return "index"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.PostService; 9 | 10 | @Controller 11 | public class HomeController { 12 | 13 | private PostService postService; 14 | 15 | @Autowired 16 | public HomeController(PostService postService){ 17 | this.postService = postService; 18 | } 19 | 20 | @RequestMapping("/") 21 | public String home(Model model){ 22 | model.addAttribute("post", postService.getLatestPost()); 23 | return "index"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/jquery.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "./core", 3 | "./selector", 4 | "./traversing", 5 | "./callbacks", 6 | "./deferred", 7 | "./core/ready", 8 | "./data", 9 | "./queue", 10 | "./queue/delay", 11 | "./attributes", 12 | "./event", 13 | "./event/alias", 14 | "./manipulation", 15 | "./manipulation/_evalUrl", 16 | "./wrap", 17 | "./css", 18 | "./css/hiddenVisibleSelectors", 19 | "./serialize", 20 | "./ajax", 21 | "./ajax/xhr", 22 | "./ajax/script", 23 | "./ajax/jsonp", 24 | "./ajax/load", 25 | "./event/ajax", 26 | "./effects", 27 | "./effects/animatedSelector", 28 | "./offset", 29 | "./dimensions", 30 | "./deprecated", 31 | "./exports/amd", 32 | "./exports/global" 33 | ], function( jQuery ) { 34 | 35 | return jQuery; 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /core-spring/configuration-properties/src/main/java/com/therealdanvega/ConfigpropsApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 6 | import org.springframework.context.ApplicationContext; 7 | 8 | @SpringBootApplication 9 | //@EnableConfigurationProperties 10 | public class ConfigpropsApplication { 11 | 12 | public static void main(String[] args) { 13 | ApplicationContext ctx = SpringApplication.run(ConfigpropsApplication.class, args); 14 | 15 | MyAppConfig config = (MyAppConfig) ctx.getBean("myAppConfig"); 16 | System.out.println(config.toString()); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.PostService; 9 | 10 | @Controller 11 | public class HomeController { 12 | 13 | private PostService postService; 14 | 15 | @Autowired 16 | public HomeController(PostService postService){ 17 | this.postService = postService; 18 | } 19 | 20 | @RequestMapping("/") 21 | public String home(Model model){ 22 | model.addAttribute("post", postService.getLatestPost()); 23 | return "index"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /guides/sending-email-async/src/main/java/com/therealdanvega/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | public class User { 4 | 5 | private String firstName; 6 | 7 | private String lastName; 8 | 9 | private String emailAddress; 10 | 11 | public User(){ 12 | 13 | } 14 | 15 | public String getFirstName() { 16 | return firstName; 17 | } 18 | 19 | public void setFirstName(String firstName) { 20 | this.firstName = firstName; 21 | } 22 | 23 | public String getLastName() { 24 | return lastName; 25 | } 26 | 27 | public void setLastName(String lastName) { 28 | this.lastName = lastName; 29 | } 30 | 31 | public String getEmailAddress() { 32 | return emailAddress; 33 | } 34 | 35 | public void setEmailAddress(String emailAddress) { 36 | this.emailAddress = emailAddress; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /guides/sending-email/src/main/java/com/therealdanvega/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | public class User { 4 | 5 | private String firstName; 6 | 7 | private String lastName; 8 | 9 | private String emailAddress; 10 | 11 | public User(){ 12 | 13 | } 14 | 15 | public String getFirstName() { 16 | return firstName; 17 | } 18 | 19 | public void setFirstName(String firstName) { 20 | this.firstName = firstName; 21 | } 22 | 23 | public String getLastName() { 24 | return lastName; 25 | } 26 | 27 | public void setLastName(String lastName) { 28 | this.lastName = lastName; 29 | } 30 | 31 | public String getEmailAddress() { 32 | return emailAddress; 33 | } 34 | 35 | public void setEmailAddress(String emailAddress) { 36 | this.emailAddress = emailAddress; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/src/exports/global.js: -------------------------------------------------------------------------------- 1 | define([ 2 | "../core", 3 | "../var/strundefined" 4 | ], function( jQuery, strundefined ) { 5 | 6 | var 7 | // Map over jQuery in case of overwrite 8 | _jQuery = window.jQuery, 9 | 10 | // Map over the $ in case of overwrite 11 | _$ = window.$; 12 | 13 | jQuery.noConflict = function( deep ) { 14 | if ( window.$ === jQuery ) { 15 | window.$ = _$; 16 | } 17 | 18 | if ( deep && window.jQuery === jQuery ) { 19 | window.jQuery = _jQuery; 20 | } 21 | 22 | return jQuery; 23 | }; 24 | 25 | // Expose jQuery and $ identifiers, even in AMD 26 | // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 27 | // and CommonJS for browser emulators (#13566) 28 | if ( typeof noGlobal === strundefined ) { 29 | window.jQuery = window.$ = jQuery; 30 | } 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /rest/rest-template/src/main/java/com/therealdanvega/domain/Location.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | public class Location { 4 | 5 | private String city; 6 | private String state; 7 | private String country; 8 | 9 | public Location(){ 10 | 11 | } 12 | 13 | public String getCity() { 14 | return city; 15 | } 16 | 17 | public void setCity(String city) { 18 | this.city = city; 19 | } 20 | 21 | public String getState() { 22 | return state; 23 | } 24 | 25 | public void setState(String state) { 26 | this.state = state; 27 | } 28 | 29 | public String getCountry() { 30 | return country; 31 | } 32 | 33 | public void setCountry(String country) { 34 | this.country = country; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "Location [city=" + city + ", state=" + state + ", country=" + country + "]"; 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/java/com/therealdanvega/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Post; 9 | import com.therealdanvega.repository.PostRepository; 10 | 11 | @Service 12 | public class PostService { 13 | 14 | private PostRepository postRepository; 15 | 16 | @Autowired 17 | public PostService(PostRepository postRepository){ 18 | this.postRepository = postRepository; 19 | } 20 | 21 | public Post getLatestPost(){ 22 | return postRepository.findFirstByOrderByPostedOnDesc(); 23 | } 24 | 25 | public List list() { 26 | return postRepository.findAllByOrderByPostedOnDesc(); 27 | } 28 | 29 | public Post getBySlug(String slug) { 30 | return postRepository.findBySlug(slug); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /rest/rest-template/src/main/java/com/therealdanvega/domain/Weather.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | public class Weather { 4 | 5 | private int temp; 6 | private String description; 7 | private Location location; 8 | 9 | public Weather(){ 10 | 11 | } 12 | 13 | public int getTemp() { 14 | return temp; 15 | } 16 | 17 | public void setTemp(int temp) { 18 | this.temp = temp; 19 | } 20 | 21 | public String getDescription() { 22 | return description; 23 | } 24 | 25 | public void setDescription(String description) { 26 | this.description = description; 27 | } 28 | 29 | public Location getLocation() { 30 | return location; 31 | } 32 | 33 | public void setLocation(Location location) { 34 | this.location = location; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "Weather [temp=" + temp + ", description=" + description + "]"; 40 | } 41 | 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /security/blog/src/main/java/com/therealdanvega/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Post; 9 | import com.therealdanvega.repository.PostRepository; 10 | 11 | @Service 12 | public class PostService { 13 | 14 | private PostRepository postRepository; 15 | 16 | @Autowired 17 | public PostService(PostRepository postRepository){ 18 | this.postRepository = postRepository; 19 | } 20 | 21 | public Post getLatestPost(){ 22 | return postRepository.findFirstByOrderByPostedOnDesc(); 23 | } 24 | 25 | public List list() { 26 | return postRepository.findAllByOrderByPostedOnDesc(); 27 | } 28 | 29 | public Post getBySlug(String slug) { 30 | return postRepository.findBySlug(slug); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /data/blogrefactor/src/main/java/com/therealdanvega/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Post; 9 | import com.therealdanvega.repository.PostRepository; 10 | 11 | @Service 12 | public class PostService { 13 | 14 | private PostRepository postRepository; 15 | 16 | @Autowired 17 | public PostService(PostRepository postRepository){ 18 | this.postRepository = postRepository; 19 | } 20 | 21 | public Post getLatestPost(){ 22 | return postRepository.findFirstByOrderByPostedOnDesc(); 23 | } 24 | 25 | public List list() { 26 | return postRepository.findAllByOrderByPostedOnDesc(); 27 | } 28 | 29 | public Post getBySlug(String slug) { 30 | return postRepository.findBySlug(slug); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/java/com/therealdanvega/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Post; 9 | import com.therealdanvega.repository.PostRepository; 10 | 11 | @Service 12 | public class PostService { 13 | 14 | private PostRepository postRepository; 15 | 16 | @Autowired 17 | public PostService(PostRepository postRepository){ 18 | this.postRepository = postRepository; 19 | } 20 | 21 | public Post getLatestPost(){ 22 | return postRepository.findFirstByOrderByPostedOnDesc(); 23 | } 24 | 25 | public List list() { 26 | return postRepository.findAllByOrderByPostedOnDesc(); 27 | } 28 | 29 | public Post getBySlug(String slug) { 30 | return postRepository.findBySlug(slug); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/resources/templates/post/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Posts 7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 |

title

15 |

postedOn

16 |
17 |
18 | teaser 19 |
20 | 26 |
27 |
28 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /security/blog/src/main/resources/templates/post/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Posts 7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 |

title

15 |

postedOn

16 |
17 |
18 | teaser 19 |
20 | 26 |
27 |
28 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /data/advqueries/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/resources/templates/post/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Posts 7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 |

title

15 |

postedOn

16 |
17 |
18 | teaser 19 |
20 | 26 |
27 |
28 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/resources/templates/post/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Posts 7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 |

title

15 |

postedOn

16 |
17 |
18 | teaser 19 |
20 | 26 |
27 |
28 | 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /web-applications/errors/src/main/java/com/therealdanvega/ErrorsApplication.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer; 6 | import org.springframework.boot.context.embedded.ErrorPage; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.http.HttpStatus; 9 | 10 | @SpringBootApplication 11 | public class ErrorsApplication { 12 | 13 | @Bean 14 | public EmbeddedServletContainerCustomizer containerCustomizer(){ 15 | return ( container -> { 16 | ErrorPage custom404Page = new ErrorPage(HttpStatus.NOT_FOUND,"/404"); 17 | container.addErrorPages(custom404Page); 18 | }); 19 | } 20 | 21 | public static void main(String[] args) { 22 | SpringApplication.run(ErrorsApplication.class, args); 23 | } 24 | } -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/java/com/therealdanvega/json/JsonDateSerializer.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.json; 2 | 3 | import java.io.IOException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Date; 6 | 7 | import com.fasterxml.jackson.core.JsonGenerator; 8 | import com.fasterxml.jackson.core.JsonProcessingException; 9 | import com.fasterxml.jackson.databind.JsonSerializer; 10 | import com.fasterxml.jackson.databind.SerializerProvider; 11 | 12 | public class JsonDateSerializer extends JsonSerializer { 13 | 14 | private static final SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a"); 15 | 16 | @Override 17 | public void serialize(Date date, JsonGenerator gen, SerializerProvider provider) 18 | throws IOException, JsonProcessingException { 19 | 20 | String formattedDate = dateFormat.format(date); 21 | 22 | gen.writeString(formattedDate); 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.AuthorService; 9 | 10 | @Controller 11 | @RequestMapping("/authors") 12 | public class AuthorController { 13 | 14 | private AuthorService authorService; 15 | 16 | @Autowired 17 | public AuthorController(AuthorService authorService) { 18 | super(); 19 | this.authorService = authorService; 20 | } 21 | 22 | @RequestMapping("/list") 23 | public String list(Model model){ 24 | model.addAttribute("authors", authorService.list()); 25 | return "author/list"; 26 | } 27 | 28 | @RequestMapping("/view") 29 | public String view(Model model){ 30 | return "author/view"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.AuthorService; 9 | 10 | @Controller 11 | @RequestMapping("/authors") 12 | public class AuthorController { 13 | 14 | private AuthorService authorService; 15 | 16 | @Autowired 17 | public AuthorController(AuthorService authorService) { 18 | super(); 19 | this.authorService = authorService; 20 | } 21 | 22 | @RequestMapping("/list") 23 | public String list(Model model){ 24 | model.addAttribute("authors", authorService.list()); 25 | return "author/list"; 26 | } 27 | 28 | @RequestMapping("/view") 29 | public String view(Model model){ 30 | return "author/view"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.AuthorService; 9 | 10 | @Controller 11 | @RequestMapping("/authors") 12 | public class AuthorController { 13 | 14 | private AuthorService authorService; 15 | 16 | @Autowired 17 | public AuthorController(AuthorService authorService) { 18 | super(); 19 | this.authorService = authorService; 20 | } 21 | 22 | @RequestMapping("/list") 23 | public String list(Model model){ 24 | model.addAttribute("authors", authorService.list()); 25 | return "author/list"; 26 | } 27 | 28 | @RequestMapping("/view") 29 | public String view(Model model){ 30 | return "author/view"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.AuthorService; 9 | 10 | @Controller 11 | @RequestMapping("/authors") 12 | public class AuthorController { 13 | 14 | private AuthorService authorService; 15 | 16 | @Autowired 17 | public AuthorController(AuthorService authorService) { 18 | super(); 19 | this.authorService = authorService; 20 | } 21 | 22 | @RequestMapping("/list") 23 | public String list(Model model){ 24 | model.addAttribute("authors", authorService.list()); 25 | return "author/list"; 26 | } 27 | 28 | @RequestMapping("/view") 29 | public String view(Model model){ 30 | return "author/view"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.AuthorService; 9 | 10 | @Controller 11 | @RequestMapping("/authors") 12 | public class AuthorController { 13 | 14 | private AuthorService authorService; 15 | 16 | @Autowired 17 | public AuthorController(AuthorService authorService) { 18 | super(); 19 | this.authorService = authorService; 20 | } 21 | 22 | @RequestMapping("/list") 23 | public String list(Model model){ 24 | model.addAttribute("authors", authorService.list()); 25 | return "author/list"; 26 | } 27 | 28 | @RequestMapping("/view") 29 | public String view(Model model){ 30 | return "author/view"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.AuthorService; 9 | 10 | @Controller 11 | @RequestMapping("/authors") 12 | public class AuthorController { 13 | 14 | private AuthorService authorService; 15 | 16 | @Autowired 17 | public AuthorController(AuthorService authorService) { 18 | super(); 19 | this.authorService = authorService; 20 | } 21 | 22 | @RequestMapping("/list") 23 | public String list(Model model){ 24 | model.addAttribute("authors", authorService.list()); 25 | return "author/list"; 26 | } 27 | 28 | @RequestMapping("/view") 29 | public String view(Model model){ 30 | return "author/view"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core-spring/profiles/src/main/java/com/therealdanvega/DataSource.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | public class DataSource { 6 | 7 | private String server; 8 | private int port; 9 | 10 | public DataSource(){ 11 | 12 | } 13 | 14 | public DataSource(String server, int port) { 15 | this.server = server; 16 | this.port = port; 17 | } 18 | 19 | public int getPort() { 20 | return port; 21 | } 22 | 23 | public void setPort(int port) { 24 | this.port = port; 25 | } 26 | 27 | public String getServer() { 28 | return server; 29 | } 30 | 31 | public void setServer(String server) { 32 | this.server = server; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return "DataSource{" + 38 | "server='" + server + '\'' + 39 | ", port=" + port + 40 | '}'; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.ui.Model; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.therealdanvega.service.AuthorService; 9 | 10 | @Controller 11 | @RequestMapping("/authors") 12 | public class AuthorController { 13 | 14 | private AuthorService authorService; 15 | 16 | @Autowired 17 | public AuthorController(AuthorService authorService) { 18 | super(); 19 | this.authorService = authorService; 20 | } 21 | 22 | @RequestMapping("/list") 23 | public String list(Model model){ 24 | model.addAttribute("authors", authorService.list()); 25 | return "author/list"; 26 | } 27 | 28 | @RequestMapping("/view") 29 | public String view(Model model){ 30 | return "author/view"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /web-applications/bower/src/main/resources/static/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "version": "2.1.4", 4 | "main": "dist/jquery.js", 5 | "license": "MIT", 6 | "ignore": [ 7 | "**/.*", 8 | "build", 9 | "dist/cdn", 10 | "speed", 11 | "test", 12 | "*.md", 13 | "AUTHORS.txt", 14 | "Gruntfile.js", 15 | "package.json" 16 | ], 17 | "devDependencies": { 18 | "sizzle": "2.1.1-jquery.2.1.2", 19 | "requirejs": "2.1.10", 20 | "qunit": "1.14.0", 21 | "sinon": "1.8.1" 22 | }, 23 | "keywords": [ 24 | "jquery", 25 | "javascript", 26 | "library" 27 | ], 28 | "homepage": "https://github.com/jquery/jquery", 29 | "_release": "2.1.4", 30 | "_resolution": { 31 | "type": "version", 32 | "tag": "2.1.4", 33 | "commit": "7751e69b615c6eca6f783a81e292a55725af6b85" 34 | }, 35 | "_source": "git://github.com/jquery/jquery.git", 36 | "_target": "~2.1.4", 37 | "_originalSource": "jquery", 38 | "_direct": true 39 | } -------------------------------------------------------------------------------- /crud/create/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Authors 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#First NameLast NameEmailPosts By Author
1First NameLast NameEmail AddressPosts By Author
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /crud/delete/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Authors 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#First NameLast NameEmailPosts By Author
1First NameLast NameEmail AddressPosts By Author
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /crud/edit/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Authors 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#First NameLast NameEmailPosts By Author
1First NameLast NameEmail AddressPosts By Author
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /crud/read/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Authors 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#First NameLast NameEmailPosts By Author
1First NameLast NameEmail AddressPosts By Author
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /crud/initial/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Authors 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#First NameLast NameEmailPosts By Author
1First NameLast NameEmail AddressPosts By Author
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /crud/validation/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Authors 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#First NameLast NameEmailPosts By Author
1First NameLast NameEmail AddressPosts By Author
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /data/jdbcdemo/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | import com.therealdanvega.service.PostService; 12 | 13 | @Controller 14 | public class HomeController { 15 | 16 | private static final Logger logger = LoggerFactory.getLogger(HomeController.class); 17 | private PostService postService; 18 | 19 | @Autowired 20 | public HomeController(PostService postService){ 21 | this.postService = postService; 22 | } 23 | 24 | @RequestMapping("/") 25 | public String home(Model model){ 26 | model.addAttribute("post", postService.getLatestPost()); 27 | return "index"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /data/mongodemo/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | import com.therealdanvega.service.PostService; 12 | 13 | @Controller 14 | public class HomeController { 15 | 16 | private static final Logger logger = LoggerFactory.getLogger(HomeController.class); 17 | private PostService postService; 18 | 19 | @Autowired 20 | public HomeController(PostService postService){ 21 | this.postService = postService; 22 | } 23 | 24 | @RequestMapping("/") 25 | public String home(Model model){ 26 | model.addAttribute("post", postService.getLatestPost()); 27 | return "index"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /security/blog/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | import com.therealdanvega.service.PostService; 12 | 13 | @Controller 14 | public class HomeController { 15 | 16 | private static final Logger logger = LoggerFactory.getLogger(HomeController.class); 17 | private PostService postService; 18 | 19 | @Autowired 20 | public HomeController(PostService postService){ 21 | this.postService = postService; 22 | } 23 | 24 | @RequestMapping("/") 25 | public String home(Model model){ 26 | model.addAttribute("post", postService.getLatestPost()); 27 | return "index"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /data/blogrefactor/src/main/java/com/therealdanvega/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | 11 | import com.therealdanvega.service.PostService; 12 | 13 | @Controller 14 | public class HomeController { 15 | 16 | private static final Logger logger = LoggerFactory.getLogger(HomeController.class); 17 | private PostService postService; 18 | 19 | @Autowired 20 | public HomeController(PostService postService){ 21 | this.postService = postService; 22 | } 23 | 24 | @RequestMapping("/") 25 | public String home(Model model){ 26 | model.addAttribute("post", postService.getLatestPost()); 27 | return "index"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /questions/mvc-controller-action/src/main/resources/templates/author/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Authors 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
#First NameLast NameEmailPosts By Author
1First NameLast NameEmail AddressPosts By Author
32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /web-applications/errors/src/main/java/com/therealdanvega/domain/Post.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | import java.util.Date; 4 | 5 | public class Post { 6 | 7 | private String title; 8 | private String body; 9 | private Date posted; 10 | private String author; 11 | 12 | public Post() { 13 | 14 | } 15 | 16 | public String getTitle() { 17 | return title; 18 | } 19 | 20 | public void setTitle(String title) { 21 | this.title = title; 22 | } 23 | 24 | public String getBody() { 25 | return body; 26 | } 27 | 28 | public void setBody(String body) { 29 | this.body = body; 30 | } 31 | 32 | public Date getPosted() { 33 | return posted; 34 | } 35 | 36 | public void setPosted(Date posted) { 37 | this.posted = posted; 38 | } 39 | 40 | public String getAuthor() { 41 | return author; 42 | } 43 | 44 | public void setAuthor(String author) { 45 | this.author = author; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return "Post [title=" + title + "]"; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /web-applications/controllers/src/main/java/com/therealdanvega/domain/Post.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.domain; 2 | 3 | import java.util.Date; 4 | 5 | public class Post { 6 | 7 | private String title; 8 | private String body; 9 | private Date posted; 10 | private String author; 11 | 12 | public Post() { 13 | 14 | } 15 | 16 | public String getTitle() { 17 | return title; 18 | } 19 | 20 | public void setTitle(String title) { 21 | this.title = title; 22 | } 23 | 24 | public String getBody() { 25 | return body; 26 | } 27 | 28 | public void setBody(String body) { 29 | this.body = body; 30 | } 31 | 32 | public Date getPosted() { 33 | return posted; 34 | } 35 | 36 | public void setPosted(Date posted) { 37 | this.posted = posted; 38 | } 39 | 40 | public String getAuthor() { 41 | return author; 42 | } 43 | 44 | public void setAuthor(String author) { 45 | this.author = author; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return "Post [title=" + title + "]"; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 8 | 9 | import com.therealdanvega.interceptor.BaseInterceptor; 10 | 11 | @Configuration 12 | public class WebConfig extends WebMvcConfigurerAdapter { 13 | 14 | @Override 15 | public void addViewControllers(ViewControllerRegistry registry) { 16 | super.addViewControllers(registry); 17 | registry.addViewController("/login").setViewName("auth/login"); 18 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | registry.addInterceptor(new BaseInterceptor()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /crud/initial/src/main/java/com/therealdanvega/service/PostService.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.therealdanvega.domain.Post; 9 | import com.therealdanvega.repository.PostRepository; 10 | 11 | @Service 12 | public class PostService { 13 | 14 | private PostRepository postRepository; 15 | 16 | @Autowired 17 | public PostService(PostRepository postRepository){ 18 | this.postRepository = postRepository; 19 | } 20 | 21 | public Post getLatestPost(){ 22 | return postRepository.findFirstByOrderByPostedOnDesc(); 23 | } 24 | 25 | public List list() { 26 | return postRepository.findAllByOrderByPostedOnDesc(); 27 | } 28 | 29 | public Post getBySlug(String slug) { 30 | return postRepository.findBySlug(slug); 31 | } 32 | 33 | public List listByAuthor(Long id) { 34 | return postRepository.findAllByAuthorIdOrderByPostedOnDesc(id); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /crud/create/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 8 | 9 | import com.therealdanvega.interceptor.BaseInterceptor; 10 | 11 | @Configuration 12 | public class WebConfig extends WebMvcConfigurerAdapter { 13 | 14 | @Override 15 | public void addViewControllers(ViewControllerRegistry registry) { 16 | super.addViewControllers(registry); 17 | registry.addViewController("/login").setViewName("auth/login"); 18 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | registry.addInterceptor(new BaseInterceptor()); 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /crud/delete/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 8 | 9 | import com.therealdanvega.interceptor.BaseInterceptor; 10 | 11 | @Configuration 12 | public class WebConfig extends WebMvcConfigurerAdapter { 13 | 14 | @Override 15 | public void addViewControllers(ViewControllerRegistry registry) { 16 | super.addViewControllers(registry); 17 | registry.addViewController("/login").setViewName("auth/login"); 18 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | registry.addInterceptor(new BaseInterceptor()); 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /crud/edit/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 8 | 9 | import com.therealdanvega.interceptor.BaseInterceptor; 10 | 11 | @Configuration 12 | public class WebConfig extends WebMvcConfigurerAdapter { 13 | 14 | @Override 15 | public void addViewControllers(ViewControllerRegistry registry) { 16 | super.addViewControllers(registry); 17 | registry.addViewController("/login").setViewName("auth/login"); 18 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | registry.addInterceptor(new BaseInterceptor()); 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /crud/read/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 8 | 9 | import com.therealdanvega.interceptor.BaseInterceptor; 10 | 11 | @Configuration 12 | public class WebConfig extends WebMvcConfigurerAdapter { 13 | 14 | @Override 15 | public void addViewControllers(ViewControllerRegistry registry) { 16 | super.addViewControllers(registry); 17 | registry.addViewController("/login").setViewName("auth/login"); 18 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | registry.addInterceptor(new BaseInterceptor()); 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /rest/rest-starter/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @RestController 12 | @RequestMapping("/authors") 13 | public class AuthorController { 14 | 15 | AuthorRepository authorRepository; 16 | 17 | @Autowired 18 | public AuthorController(AuthorRepository authorRepository){ 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | @RequestMapping("/") 23 | public Iterable list(){ 24 | return authorRepository.findAll(); 25 | } 26 | 27 | @RequestMapping("/{id}") 28 | public Author read(@PathVariable(value="id") long id){ 29 | return authorRepository.findOne(id); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /crud/edit/src/main/resources/templates/post/view.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | View Post 7 | 8 | 9 | 10 |
11 | 12 | 17 | 18 |
19 |
20 |

title

21 |

postedOn

22 |
23 |
24 | body 25 |
26 |
27 |
28 | Posted By author 29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /crud/read/src/main/resources/templates/post/view.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | View Post 7 | 8 | 9 | 10 |
11 | 12 | 17 | 18 |
19 |
20 |

title

21 |

postedOn

22 |
23 |
24 | body 25 |
26 |
27 |
28 | Posted By author 29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /crud/validation/src/main/java/com/therealdanvega/config/WebConfig.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.core.Ordered; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 8 | 9 | import com.therealdanvega.interceptor.BaseInterceptor; 10 | 11 | @Configuration 12 | public class WebConfig extends WebMvcConfigurerAdapter { 13 | 14 | @Override 15 | public void addViewControllers(ViewControllerRegistry registry) { 16 | super.addViewControllers(registry); 17 | registry.addViewController("/login").setViewName("auth/login"); 18 | registry.setOrder(Ordered.HIGHEST_PRECEDENCE); 19 | } 20 | 21 | @Override 22 | public void addInterceptors(InterceptorRegistry registry) { 23 | registry.addInterceptor(new BaseInterceptor()); 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /rest/rest-error-handling/src/main/java/com/therealdanvega/controller/AuthorController.java: -------------------------------------------------------------------------------- 1 | package com.therealdanvega.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import com.therealdanvega.domain.Author; 9 | import com.therealdanvega.repository.AuthorRepository; 10 | 11 | @RestController 12 | @RequestMapping("/authors") 13 | public class AuthorController { 14 | 15 | AuthorRepository authorRepository; 16 | 17 | @Autowired 18 | public AuthorController(AuthorRepository authorRepository){ 19 | this.authorRepository = authorRepository; 20 | } 21 | 22 | @RequestMapping("/") 23 | public Iterable list(){ 24 | return authorRepository.findAll(); 25 | } 26 | 27 | @RequestMapping("/{id}") 28 | public Author read(@PathVariable(value="id") long id){ 29 | return authorRepository.findOne(id); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /crud/create/src/main/resources/templates/post/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Posts 7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 |

title

15 |

postedOn

16 |
17 |
18 | teaser 19 |
20 | 26 |
27 |
28 | 29 |

30 |

31 |

32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /crud/create/src/main/resources/templates/post/view.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | View Post 7 | 8 | 9 | 10 |
11 | 12 | 17 | 18 |
19 |
20 |

title

21 |

postedOn

22 |
23 |
24 | body 25 |
26 |
27 |
28 | Posted By author 29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /crud/delete/src/main/resources/templates/post/list.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | List Posts 7 | 8 | 9 | 10 |
11 | 12 |
13 |
14 |

title

15 |

postedOn

16 |
17 |
18 | teaser 19 |
20 | 26 |
27 |
28 | 29 |

30 |

31 |

32 | 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /crud/delete/src/main/resources/templates/post/view.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | View Post 7 | 8 | 9 | 10 |
11 | 12 | 17 | 18 |
19 |
20 |

title

21 |

postedOn

22 |
23 |
24 | body 25 |
26 |
27 |
28 | Posted By author 29 |
30 |
31 |
32 |
33 | 34 |
35 | 36 | 37 | --------------------------------------------------------------------------------