├── Page Fragments e Projeto Final ├── HELP.md ├── curso-spring-boot │ └── README.md ├── fragments.iml ├── mvnw ├── mvnw.cmd ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── codegate01 │ │ │ │ └── fragments │ │ │ │ ├── FragmentsApplication.java │ │ │ │ └── HomeController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ ├── base.html │ │ │ ├── blog.html │ │ │ ├── contact.html │ │ │ └── index.html │ └── test │ │ └── java │ │ └── com │ │ └── codegate01 │ │ └── fragments │ │ └── FragmentsApplicationTests.java └── target │ ├── classes │ ├── application.properties │ ├── com │ │ └── codegate01 │ │ │ └── fragments │ │ │ ├── FragmentsApplication.class │ │ │ └── HomeController.class │ └── templates │ │ ├── base.html │ │ ├── blog.html │ │ ├── contact.html │ │ └── index.html │ ├── fragments-0.0.1-SNAPSHOT.jar │ ├── fragments-0.0.1-SNAPSHOT.jar.original │ ├── maven-archiver │ └── pom.properties │ ├── maven-status │ └── maven-compiler-plugin │ │ ├── compile │ │ └── default-compile │ │ │ ├── createdFiles.lst │ │ │ └── inputFiles.lst │ │ └── testCompile │ │ └── default-testCompile │ │ ├── createdFiles.lst │ │ └── inputFiles.lst │ ├── surefire-reports │ ├── TEST-com.codegate01.fragments.FragmentsApplicationTests.xml │ └── com.codegate01.fragments.FragmentsApplicationTests.txt │ └── test-classes │ └── com │ └── codegate01 │ └── fragments │ └── FragmentsApplicationTests.class ├── README.md ├── spring-security ├── HELP.md ├── pom.xml ├── spring-security.iml ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── springsecurity │ │ │ │ ├── DataLoader.java │ │ │ │ ├── SecurityConfiguration.java │ │ │ │ ├── SpringSecurityApplication.java │ │ │ │ ├── controllers │ │ │ │ └── HomeController.java │ │ │ │ ├── model │ │ │ │ ├── Role.java │ │ │ │ └── User.java │ │ │ │ ├── repository │ │ │ │ ├── RoleRepository.java │ │ │ │ └── UserRepository.java │ │ │ │ └── services │ │ │ │ └── SSUserDetailsService.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ ├── admin.html │ │ │ ├── index.html │ │ │ ├── login.html │ │ │ └── secure.html │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── springsecurity │ │ └── SpringSecurityApplicationTests.java └── target │ ├── classes │ ├── application.properties │ ├── com │ │ └── example │ │ │ └── springsecurity │ │ │ ├── DataLoader.class │ │ │ ├── SecurityConfiguration.class │ │ │ ├── SpringSecurityApplication.class │ │ │ ├── controllers │ │ │ └── HomeController.class │ │ │ ├── model │ │ │ ├── Role.class │ │ │ └── User.class │ │ │ ├── repository │ │ │ ├── RoleRepository.class │ │ │ └── UserRepository.class │ │ │ └── services │ │ │ └── SSUserDetailsService.class │ └── templates │ │ ├── admin.html │ │ ├── index.html │ │ ├── login.html │ │ └── secure.html │ └── test-classes │ └── com │ └── example │ └── springsecurity │ └── SpringSecurityApplicationTests.class └── thymeleaf-demo ├── HELP.md ├── mvnw ├── mvnw.cmd ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── codegate │ │ │ └── demo │ │ │ ├── HomeController.java │ │ │ └── ThymeleafApplication.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ ├── base.html │ │ ├── blog.html │ │ ├── contact.html │ │ └── index.html └── test │ └── java │ └── com │ └── codegate │ └── demo │ └── ThymeleafApplicationTests.java ├── target ├── classes │ ├── application.properties │ ├── com │ │ └── codegate │ │ │ └── demo │ │ │ ├── HomeController.class │ │ │ └── ThymeleafApplication.class │ └── templates │ │ ├── base.html │ │ ├── blog.html │ │ ├── contact.html │ │ └── index.html └── test-classes │ └── com │ └── codegate │ └── demo │ └── ThymeleafApplicationTests.class └── thymeleaf-demo.iml /Page Fragments e Projeto Final/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.0/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.0/maven-plugin/reference/html/#build-image) 9 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.0/reference/htmlsingle/#boot-features-developing-web-applications) 10 | * [Thymeleaf](https://docs.spring.io/spring-boot/docs/2.4.0/reference/htmlsingle/#boot-features-spring-mvc-template-engines) 11 | 12 | ### Guides 13 | The following guides illustrate how to use some features concretely: 14 | 15 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 16 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 17 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 18 | * [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/) 19 | 20 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/curso-spring-boot/README.md: -------------------------------------------------------------------------------- 1 | # curso-spring-boot -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/fragments.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ]; then 38 | 39 | if [ -f /etc/mavenrc ]; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ]; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false 51 | darwin=false 52 | mingw=false 53 | case "$(uname)" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true ;; 56 | Darwin*) 57 | darwin=true 58 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 59 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 60 | if [ -z "$JAVA_HOME" ]; then 61 | if [ -x "/usr/libexec/java_home" ]; then 62 | export JAVA_HOME="$(/usr/libexec/java_home)" 63 | else 64 | export JAVA_HOME="/Library/Java/Home" 65 | fi 66 | fi 67 | ;; 68 | esac 69 | 70 | if [ -z "$JAVA_HOME" ]; then 71 | if [ -r /etc/gentoo-release ]; then 72 | JAVA_HOME=$(java-config --jre-home) 73 | fi 74 | fi 75 | 76 | if [ -z "$M2_HOME" ]; then 77 | ## resolve links - $0 may be a link to maven's home 78 | PRG="$0" 79 | 80 | # need this for relative symlinks 81 | while [ -h "$PRG" ]; do 82 | ls=$(ls -ld "$PRG") 83 | link=$(expr "$ls" : '.*-> \(.*\)$') 84 | if expr "$link" : '/.*' >/dev/null; then 85 | PRG="$link" 86 | else 87 | PRG="$(dirname "$PRG")/$link" 88 | fi 89 | done 90 | 91 | saveddir=$(pwd) 92 | 93 | M2_HOME=$(dirname "$PRG")/.. 94 | 95 | # make it fully qualified 96 | M2_HOME=$(cd "$M2_HOME" && pwd) 97 | 98 | cd "$saveddir" 99 | # echo Using m2 at $M2_HOME 100 | fi 101 | 102 | # For Cygwin, ensure paths are in UNIX format before anything is touched 103 | if $cygwin; then 104 | [ -n "$M2_HOME" ] && 105 | M2_HOME=$(cygpath --unix "$M2_HOME") 106 | [ -n "$JAVA_HOME" ] && 107 | JAVA_HOME=$(cygpath --unix "$JAVA_HOME") 108 | [ -n "$CLASSPATH" ] && 109 | CLASSPATH=$(cygpath --path --unix "$CLASSPATH") 110 | fi 111 | 112 | # For Mingw, ensure paths are in UNIX format before anything is touched 113 | if $mingw; then 114 | [ -n "$M2_HOME" ] && 115 | M2_HOME="$( ( 116 | cd "$M2_HOME" 117 | pwd 118 | ))" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="$( ( 121 | cd "$JAVA_HOME" 122 | pwd 123 | ))" 124 | fi 125 | 126 | if [ -z "$JAVA_HOME" ]; then 127 | javaExecutable="$(which javac)" 128 | if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then 129 | # readlink(1) is not available as standard on Solaris 10. 130 | readLink=$(which readlink) 131 | if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then 132 | if $darwin; then 133 | javaHome="$(dirname \"$javaExecutable\")" 134 | javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac" 135 | else 136 | javaExecutable="$(readlink -f \"$javaExecutable\")" 137 | fi 138 | javaHome="$(dirname \"$javaExecutable\")" 139 | javaHome=$(expr "$javaHome" : '\(.*\)/bin') 140 | JAVA_HOME="$javaHome" 141 | export JAVA_HOME 142 | fi 143 | fi 144 | fi 145 | 146 | if [ -z "$JAVACMD" ]; then 147 | if [ -n "$JAVA_HOME" ]; then 148 | if [ -x "$JAVA_HOME/jre/sh/java" ]; then 149 | # IBM's JDK on AIX uses strange locations for the executables 150 | JAVACMD="$JAVA_HOME/jre/sh/java" 151 | else 152 | JAVACMD="$JAVA_HOME/bin/java" 153 | fi 154 | else 155 | JAVACMD="$(which java)" 156 | fi 157 | fi 158 | 159 | if [ ! -x "$JAVACMD" ]; then 160 | echo "Error: JAVA_HOME is not defined correctly." >&2 161 | echo " We cannot execute $JAVACMD" >&2 162 | exit 1 163 | fi 164 | 165 | if [ -z "$JAVA_HOME" ]; then 166 | echo "Warning: JAVA_HOME environment variable is not set." 167 | fi 168 | 169 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 170 | 171 | # traverses directory structure from process work directory to filesystem root 172 | # first directory with .mvn subdirectory is considered project base directory 173 | find_maven_basedir() { 174 | 175 | if [ -z "$1" ]; then 176 | echo "Path not specified to find_maven_basedir" 177 | return 1 178 | fi 179 | 180 | basedir="$1" 181 | wdir="$1" 182 | while [ "$wdir" != '/' ]; do 183 | if [ -d "$wdir"/.mvn ]; then 184 | basedir=$wdir 185 | break 186 | fi 187 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 188 | if [ -d "${wdir}" ]; then 189 | wdir=$( 190 | cd "$wdir/.." 191 | pwd 192 | ) 193 | fi 194 | # end of workaround 195 | done 196 | echo "${basedir}" 197 | } 198 | 199 | # concatenates all lines of a file 200 | concat_lines() { 201 | if [ -f "$1" ]; then 202 | echo "$(tr -s '\n' ' ' <"$1")" 203 | fi 204 | } 205 | 206 | BASE_DIR=$(find_maven_basedir "$(pwd)") 207 | if [ -z "$BASE_DIR" ]; then 208 | exit 1 209 | fi 210 | 211 | ########################################################################################## 212 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 213 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 214 | ########################################################################################## 215 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 216 | if [ "$MVNW_VERBOSE" = true ]; then 217 | echo "Found .mvn/wrapper/maven-wrapper.jar" 218 | fi 219 | else 220 | if [ "$MVNW_VERBOSE" = true ]; then 221 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 222 | fi 223 | if [ -n "$MVNW_REPOURL" ]; then 224 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 225 | else 226 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 227 | fi 228 | while IFS="=" read key value; do 229 | case "$key" in wrapperUrl) 230 | jarUrl="$value" 231 | break 232 | ;; 233 | esac 234 | done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 235 | if [ "$MVNW_VERBOSE" = true ]; then 236 | echo "Downloading from: $jarUrl" 237 | fi 238 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 239 | if $cygwin; then 240 | wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") 241 | fi 242 | 243 | if command -v wget >/dev/null; then 244 | if [ "$MVNW_VERBOSE" = true ]; then 245 | echo "Found wget ... using wget" 246 | fi 247 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 248 | wget "$jarUrl" -O "$wrapperJarPath" 249 | else 250 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 251 | fi 252 | elif command -v curl >/dev/null; then 253 | if [ "$MVNW_VERBOSE" = true ]; then 254 | echo "Found curl ... using curl" 255 | fi 256 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 257 | curl -o "$wrapperJarPath" "$jarUrl" -f 258 | else 259 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 260 | fi 261 | 262 | else 263 | if [ "$MVNW_VERBOSE" = true ]; then 264 | echo "Falling back to using Java to download" 265 | fi 266 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 267 | # For Cygwin, switch paths to Windows format before running javac 268 | if $cygwin; then 269 | javaClass=$(cygpath --path --windows "$javaClass") 270 | fi 271 | if [ -e "$javaClass" ]; then 272 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Compiling MavenWrapperDownloader.java ..." 275 | fi 276 | # Compiling the Java class 277 | ("$JAVA_HOME/bin/javac" "$javaClass") 278 | fi 279 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 280 | # Running the downloader 281 | if [ "$MVNW_VERBOSE" = true ]; then 282 | echo " - Running MavenWrapperDownloader.java ..." 283 | fi 284 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 285 | fi 286 | fi 287 | fi 288 | fi 289 | ########################################################################################## 290 | # End of extension 291 | ########################################################################################## 292 | 293 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 294 | if [ "$MVNW_VERBOSE" = true ]; then 295 | echo $MAVEN_PROJECTBASEDIR 296 | fi 297 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 298 | 299 | # For Cygwin, switch paths to Windows format before running java 300 | if $cygwin; then 301 | [ -n "$M2_HOME" ] && 302 | M2_HOME=$(cygpath --path --windows "$M2_HOME") 303 | [ -n "$JAVA_HOME" ] && 304 | JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") 305 | [ -n "$CLASSPATH" ] && 306 | CLASSPATH=$(cygpath --path --windows "$CLASSPATH") 307 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 308 | MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") 309 | fi 310 | 311 | # Provide a "standardized" way to retrieve the CLI args that will 312 | # work with both Windows and non-Windows executions. 313 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 314 | export MAVEN_CMD_LINE_ARGS 315 | 316 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 317 | 318 | exec "$JAVACMD" \ 319 | $MAVEN_OPTS \ 320 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 321 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 322 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 323 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.0 9 | 10 | 11 | com.codegate01 12 | fragments 13 | 0.0.1-SNAPSHOT 14 | fragments 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-thymeleaf 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-web 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-test 34 | test 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-maven-plugin 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/main/java/com/codegate01/fragments/FragmentsApplication.java: -------------------------------------------------------------------------------- 1 | package com.codegate01.fragments; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class FragmentsApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(FragmentsApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/main/java/com/codegate01/fragments/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.codegate01.fragments; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | 6 | @Controller 7 | public class HomeController { 8 | 9 | 10 | @RequestMapping("/") 11 | public String index(){ 12 | return "index"; 13 | } 14 | 15 | @RequestMapping("/blog") 16 | public String blog(){ 17 | return "blog"; 18 | } 19 | 20 | @RequestMapping("/contact") 21 | public String contact(){ 22 | return "contact"; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=5000 -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/main/resources/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 |
18 | 19 | 33 | 34 |
35 | 36 | 37 |
38 |
39 |
40 |
Curso Java Spring Boot
41 |

Visita a nossa escola digital em www.codegate01.com

42 |
43 |
44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/main/resources/templates/blog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 | 9 |
10 | 11 |
12 | 13 | 16 |
17 | 18 |
19 | 20 | 21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/main/resources/templates/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Contacto 6 | 7 | 8 | 9 |
10 |
11 | 14 |
15 |
16 | 17 | 18 |
19 |
20 | 21 | 26 |
27 |
28 | 29 | 30 |
31 | 32 |
33 |
34 | 35 | 36 | 37 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 |
11 |
12 |

Cursos

13 |

Cursos para programadores

14 |
15 |
16 | 17 |
18 |
19 | 20 |
21 |
22 |

Comunidade

23 |

Junta-te as nossas comunidades no Facebook e Discord

24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/src/test/java/com/codegate01/fragments/FragmentsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.codegate01.fragments; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class FragmentsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | server.port=5000 -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/classes/com/codegate01/fragments/FragmentsApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/Page Fragments e Projeto Final/target/classes/com/codegate01/fragments/FragmentsApplication.class -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/classes/com/codegate01/fragments/HomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/Page Fragments e Projeto Final/target/classes/com/codegate01/fragments/HomeController.class -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/classes/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 |
18 | 19 | 33 | 34 |
35 | 36 | 37 |
38 |
39 |
40 |
Curso Java Spring Boot
41 |

Visita a nossa escola digital em www.codegate01.com

42 |
43 |
44 |
45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/classes/templates/blog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 | 9 |
10 | 11 |
12 | 13 | 16 |
17 | 18 |
19 | 20 | 21 |
22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/classes/templates/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Contacto 6 | 7 | 8 | 9 |
10 |
11 | 14 |
15 |
16 | 17 | 18 |
19 |
20 | 21 | 26 |
27 |
28 | 29 | 30 |
31 | 32 |
33 |
34 | 35 | 36 | 37 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/classes/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 |
11 |
12 |

Cursos

13 |

Cursos para programadores

14 |
15 |
16 | 17 |
18 |
19 | 20 |
21 |
22 |

Comunidade

23 |

Junta-te as nossas comunidades no Facebook e Discord

24 |
25 | 26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/fragments-0.0.1-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/Page Fragments e Projeto Final/target/fragments-0.0.1-SNAPSHOT.jar -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/fragments-0.0.1-SNAPSHOT.jar.original: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/Page Fragments e Projeto Final/target/fragments-0.0.1-SNAPSHOT.jar.original -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | artifactId=fragments 2 | groupId=com.codegate01 3 | version=0.0.1-SNAPSHOT 4 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | com\codegate01\fragments\FragmentsApplication.class 2 | com\codegate01\fragments\HomeController.class 3 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | C:\temp\java_testing_projects\fragments - Copy\src\main\java\com\codegate01\fragments\FragmentsApplication.java 2 | C:\temp\java_testing_projects\fragments - Copy\src\main\java\com\codegate01\fragments\HomeController.java 3 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | com\codegate01\fragments\FragmentsApplicationTests.class 2 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | C:\temp\java_testing_projects\fragments - Copy\src\test\java\com\codegate01\fragments\FragmentsApplicationTests.java 2 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/surefire-reports/TEST-com.codegate01.fragments.FragmentsApplicationTests.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/surefire-reports/com.codegate01.fragments.FragmentsApplicationTests.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: com.codegate01.fragments.FragmentsApplicationTests 3 | ------------------------------------------------------------------------------- 4 | Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.764 s - in com.codegate01.fragments.FragmentsApplicationTests 5 | -------------------------------------------------------------------------------- /Page Fragments e Projeto Final/target/test-classes/com/codegate01/fragments/FragmentsApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/Page Fragments e Projeto Final/target/test-classes/com/codegate01/fragments/FragmentsApplicationTests.class -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # curso-spring-boot -------------------------------------------------------------------------------- /spring-security/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.3.5.RELEASE/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.3.5.RELEASE/maven-plugin/reference/html/#build-image) 9 | * [Spring Security](https://docs.spring.io/spring-boot/docs/2.3.5.RELEASE/reference/htmlsingle/#boot-features-security) 10 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.3.5.RELEASE/reference/htmlsingle/#boot-features-developing-web-applications) 11 | * [Thymeleaf](https://docs.spring.io/spring-boot/docs/2.3.5.RELEASE/reference/htmlsingle/#boot-features-spring-mvc-template-engines) 12 | 13 | ### Guides 14 | The following guides illustrate how to use some features concretely: 15 | 16 | * [Securing a Web Application](https://spring.io/guides/gs/securing-web/) 17 | * [Spring Boot and OAuth2](https://spring.io/guides/tutorials/spring-boot-oauth2/) 18 | * [Authenticating a User with LDAP](https://spring.io/guides/gs/authenticating-ldap/) 19 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 20 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 21 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 22 | * [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/) 23 | 24 | -------------------------------------------------------------------------------- /spring-security/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.0 9 | 10 | 11 | com.codegate01 12 | fragments 13 | 0.0.1-SNAPSHOT 14 | fragments 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-thymeleaf 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-web 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-security 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-data-jpa 38 | 39 | 40 | 41 | com.h2database 42 | h2 43 | runtime 44 | 45 | 46 | 47 | org.springframework.boot 48 | spring-boot-starter-test 49 | test 50 | 51 | 52 | 53 | 54 | 55 | 56 | org.springframework.boot 57 | spring-boot-maven-plugin 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /spring-security/spring-security.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/DataLoader.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity; 2 | 3 | import com.example.springsecurity.model.Role; 4 | import com.example.springsecurity.model.User; 5 | import com.example.springsecurity.repository.RoleRepository; 6 | import com.example.springsecurity.repository.UserRepository; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.CommandLineRunner; 9 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 10 | import org.springframework.stereotype.Component; 11 | 12 | import java.util.Arrays; 13 | 14 | @Component 15 | public class DataLoader implements CommandLineRunner { 16 | 17 | @Autowired 18 | UserRepository userRepository; 19 | @Autowired 20 | RoleRepository roleRepository; 21 | @Autowired 22 | private BCryptPasswordEncoder passwordEncoder; 23 | 24 | 25 | @Override 26 | public void run(String... args) throws Exception { 27 | roleRepository.save(new Role("USER")); 28 | roleRepository.save(new Role("ADMIN")); 29 | 30 | Role adminRole = roleRepository.findByRole("ADMIN"); 31 | Role userRole = roleRepository.findByRole("USER"); 32 | 33 | User user = new User("admin@code.com", passwordEncoder.encode("password"),"Admin", "Super", true, "admin" ); 34 | user.setRoles(Arrays.asList(adminRole)); 35 | userRepository.save(user); 36 | 37 | user = new User("user@code.com", passwordEncoder.encode("password"),"User", "Super", true, "user" ); 38 | user.setRoles(Arrays.asList(userRole)); 39 | userRepository.save(user); 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/SecurityConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity; 2 | 3 | import com.example.springsecurity.repository.UserRepository; 4 | import com.example.springsecurity.services.SSUserDetailsService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 9 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 10 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 11 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 12 | import org.springframework.security.core.userdetails.UserDetailsService; 13 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 14 | import org.springframework.security.web.util.matcher.AntPathRequestMatcher; 15 | 16 | @Configuration 17 | @EnableWebSecurity 18 | public class SecurityConfiguration extends WebSecurityConfigurerAdapter { 19 | 20 | @Bean 21 | public static BCryptPasswordEncoder passwordEncoder(){ 22 | return new BCryptPasswordEncoder(); 23 | } 24 | 25 | 26 | @Autowired 27 | private SSUserDetailsService userDetailsService; 28 | 29 | @Autowired 30 | private UserRepository userRepository; 31 | 32 | @Override 33 | public UserDetailsService userDetailsServiceBean() throws Exception{ 34 | return new SSUserDetailsService(userRepository); 35 | } 36 | 37 | @Override 38 | protected void configure(HttpSecurity http) throws Exception { 39 | http.authorizeRequests() 40 | .antMatchers("/", "/h2-console/**").permitAll() 41 | .antMatchers("/admin").access("hasAuthority('ADMIN')") 42 | .anyRequest().authenticated() 43 | .and().formLogin().loginPage("/login").permitAll() 44 | .and() 45 | .logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")) 46 | .logoutSuccessUrl("/login").permitAll() 47 | .and() 48 | .httpBasic(); 49 | 50 | http.csrf().disable(); 51 | http.headers().frameOptions().disable(); 52 | } 53 | 54 | @Override 55 | protected void configure(AuthenticationManagerBuilder auth) throws Exception{ 56 | /* auth.inMemoryAuthentication() 57 | .withUser("david").password(passwordEncoder().encode("david2020")) 58 | .authorities("ADMIN") 59 | .and() 60 | .withUser("user") 61 | .password(passwordEncoder().encode("password")) 62 | .authorities("USER");*/ 63 | auth.userDetailsService(userDetailsServiceBean()) 64 | .passwordEncoder(passwordEncoder()); 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/SpringSecurityApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringSecurityApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringSecurityApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/controllers/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity.controllers; 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("/login") 10 | public String login(){ 11 | return"login"; 12 | } 13 | 14 | @RequestMapping("/") 15 | public String index(){ 16 | return "index"; 17 | } 18 | 19 | @RequestMapping("/admin") 20 | public String admin(){ 21 | return "admin"; 22 | } 23 | 24 | @RequestMapping("/secure") 25 | public String secure(){ 26 | return "secure"; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Collection; 5 | 6 | @Entity 7 | public class Role { 8 | 9 | @Id 10 | @GeneratedValue(strategy = GenerationType.AUTO) 11 | private long id; 12 | 13 | @Column(unique = true) 14 | private String role; 15 | 16 | @ManyToMany(mappedBy = "roles", fetch = FetchType.LAZY) 17 | private Collection users; 18 | 19 | public Role() { 20 | 21 | } 22 | 23 | public Role(String role){ 24 | this.role = role; 25 | 26 | } 27 | 28 | public long getId() { 29 | return id; 30 | } 31 | 32 | public void setId(long id) { 33 | this.id = id; 34 | } 35 | 36 | public String getRole() { 37 | return role; 38 | } 39 | 40 | public void setRole(String role) { 41 | this.role = role; 42 | } 43 | 44 | public Collection getUsers() { 45 | return users; 46 | } 47 | 48 | public void setUsers(Collection users) { 49 | this.users = users; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/model/User.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity.model; 2 | 3 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 4 | 5 | import javax.persistence.*; 6 | import java.util.Collection; 7 | 8 | @Entity 9 | @Table(name = "User") 10 | public class User { 11 | 12 | @Id 13 | @GeneratedValue(strategy = GenerationType.AUTO) 14 | private long id; 15 | 16 | @Column(name="email", nullable = false) 17 | private String email; 18 | 19 | @Column(name = "password") 20 | private String password; 21 | 22 | @Column(name = "name") 23 | private String name; 24 | 25 | @Column(name="last_name") 26 | private String last_name; 27 | 28 | @Column(name = "enable") 29 | private boolean enabled; 30 | 31 | @Column(name = "username") 32 | private String username; 33 | 34 | @ManyToMany(fetch = FetchType.EAGER) 35 | @JoinTable(joinColumns = @JoinColumn(name = "user_id"), 36 | inverseJoinColumns = @JoinColumn(name = "role_id")) 37 | private Collection roles; 38 | 39 | public User(){ 40 | 41 | } 42 | 43 | public User(String email, String password, String name, String last_name, boolean enabled, String username) { 44 | this.email = email; 45 | this.password = password; 46 | this.name = name; 47 | this.last_name = last_name; 48 | this.enabled = enabled; 49 | this.username = username; 50 | } 51 | 52 | public long getId() { 53 | return id; 54 | } 55 | 56 | public void setId(long id) { 57 | this.id = id; 58 | } 59 | 60 | public String getEmail() { 61 | return email; 62 | } 63 | 64 | public void setEmail(String email) { 65 | this.email = email; 66 | } 67 | 68 | public String getPassword() { 69 | return password; 70 | } 71 | 72 | public void setPassword(String password) { 73 | BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); 74 | this.password = passwordEncoder.encode(password); 75 | } 76 | 77 | public String getName() { 78 | return name; 79 | } 80 | 81 | public void setName(String name) { 82 | this.name = name; 83 | } 84 | 85 | public String getLast_name() { 86 | return last_name; 87 | } 88 | 89 | public void setLast_name(String last_name) { 90 | this.last_name = last_name; 91 | } 92 | 93 | public boolean isEnabled() { 94 | return enabled; 95 | } 96 | 97 | public void setEnabled(boolean enabled) { 98 | this.enabled = enabled; 99 | } 100 | 101 | public String getUsername() { 102 | return username; 103 | } 104 | 105 | public void setUsername(String username) { 106 | this.username = username; 107 | } 108 | 109 | public Collection getRoles() { 110 | return roles; 111 | } 112 | 113 | public void setRoles(Collection roles) { 114 | this.roles = roles; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity.repository; 2 | 3 | import com.example.springsecurity.model.Role; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface RoleRepository extends CrudRepository { 7 | Role findByRole(String role); 8 | } 9 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity.repository; 2 | 3 | import com.example.springsecurity.model.User; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | public interface UserRepository extends CrudRepository { 7 | User findByUsername(String username); 8 | } 9 | -------------------------------------------------------------------------------- /spring-security/src/main/java/com/example/springsecurity/services/SSUserDetailsService.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity.services; 2 | 3 | import com.example.springsecurity.model.Role; 4 | import com.example.springsecurity.model.User; 5 | import com.example.springsecurity.repository.UserRepository; 6 | import org.springframework.security.core.GrantedAuthority; 7 | import org.springframework.security.core.Transient; 8 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 9 | import org.springframework.security.core.userdetails.UserDetails; 10 | import org.springframework.security.core.userdetails.UserDetailsService; 11 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 12 | import org.springframework.stereotype.Service; 13 | 14 | import javax.transaction.Transactional; 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | 18 | @Transactional 19 | @Service 20 | public class SSUserDetailsService implements UserDetailsService { 21 | 22 | private UserRepository userRepository; 23 | 24 | public SSUserDetailsService(UserRepository userRepository){ 25 | this.userRepository = userRepository; 26 | } 27 | 28 | @Override 29 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 30 | try { 31 | User user = userRepository.findByUsername(username); 32 | if(user==null){ 33 | return null; 34 | } 35 | return new org.springframework.security.core.userdetails.User(user.getUsername(), user.getPassword(), getAuthories(user)); 36 | } 37 | 38 | catch (Exception e) 39 | { 40 | throw new UsernameNotFoundException("User not found!"); 41 | } 42 | } 43 | 44 | private Set getAuthories(User user){ 45 | 46 | Set authorities = new HashSet<>(); 47 | for (Role role: user.getRoles()){ 48 | GrantedAuthority grantedAuthority = new SimpleGrantedAuthority(role.getRole()); 49 | authorities.add(grantedAuthority); 50 | } 51 | return authorities; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | spring.jpa.hibernate.ddl-auto=create 4 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/admin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

Administrador

9 | 10 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

Insecure Page

9 | Secure Page 10 | 11 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login 7 | 8 | 9 |
10 | Senha ou username invalido! 11 |
12 | 13 |
14 | Voce esta desconectado! 15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 | 31 | -------------------------------------------------------------------------------- /spring-security/src/main/resources/templates/secure.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Secure Page 6 | 7 | 8 |

Secure Page

9 | logout 10 | 11 | -------------------------------------------------------------------------------- /spring-security/src/test/java/com/example/springsecurity/SpringSecurityApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.springsecurity; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringSecurityApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-security/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.h2.console.enabled=true 2 | spring.h2.console.path=/h2-console 3 | spring.jpa.hibernate.ddl-auto=create 4 | -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/DataLoader.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/DataLoader.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/SecurityConfiguration.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/SecurityConfiguration.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/SpringSecurityApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/SpringSecurityApplication.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/controllers/HomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/controllers/HomeController.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/model/Role.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/model/Role.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/model/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/model/User.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/repository/RoleRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/repository/RoleRepository.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/repository/UserRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/repository/UserRepository.class -------------------------------------------------------------------------------- /spring-security/target/classes/com/example/springsecurity/services/SSUserDetailsService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/classes/com/example/springsecurity/services/SSUserDetailsService.class -------------------------------------------------------------------------------- /spring-security/target/classes/templates/admin.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

Administrador

9 | 10 | -------------------------------------------------------------------------------- /spring-security/target/classes/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

Insecure Page

9 | Secure Page 10 | 11 | -------------------------------------------------------------------------------- /spring-security/target/classes/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Login 7 | 8 | 9 |
10 | Senha ou username invalido! 11 |
12 | 13 |
14 | Voce esta desconectado! 15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 | 23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 | 31 | -------------------------------------------------------------------------------- /spring-security/target/classes/templates/secure.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Secure Page 6 | 7 | 8 |

Secure Page

9 | logout 10 | 11 | -------------------------------------------------------------------------------- /spring-security/target/test-classes/com/example/springsecurity/SpringSecurityApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/spring-security/target/test-classes/com/example/springsecurity/SpringSecurityApplicationTests.class -------------------------------------------------------------------------------- /thymeleaf-demo/HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.0/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.0/maven-plugin/reference/html/#build-image) 9 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.4.0/reference/htmlsingle/#boot-features-developing-web-applications) 10 | * [Thymeleaf](https://docs.spring.io/spring-boot/docs/2.4.0/reference/htmlsingle/#boot-features-spring-mvc-template-engines) 11 | 12 | ### Guides 13 | The following guides illustrate how to use some features concretely: 14 | 15 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 16 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 17 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 18 | * [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/) 19 | 20 | -------------------------------------------------------------------------------- /thymeleaf-demo/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ]; then 38 | 39 | if [ -f /etc/mavenrc ]; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ]; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false 51 | darwin=false 52 | mingw=false 53 | case "$(uname)" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true ;; 56 | Darwin*) 57 | darwin=true 58 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 59 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 60 | if [ -z "$JAVA_HOME" ]; then 61 | if [ -x "/usr/libexec/java_home" ]; then 62 | export JAVA_HOME="$(/usr/libexec/java_home)" 63 | else 64 | export JAVA_HOME="/Library/Java/Home" 65 | fi 66 | fi 67 | ;; 68 | esac 69 | 70 | if [ -z "$JAVA_HOME" ]; then 71 | if [ -r /etc/gentoo-release ]; then 72 | JAVA_HOME=$(java-config --jre-home) 73 | fi 74 | fi 75 | 76 | if [ -z "$M2_HOME" ]; then 77 | ## resolve links - $0 may be a link to maven's home 78 | PRG="$0" 79 | 80 | # need this for relative symlinks 81 | while [ -h "$PRG" ]; do 82 | ls=$(ls -ld "$PRG") 83 | link=$(expr "$ls" : '.*-> \(.*\)$') 84 | if expr "$link" : '/.*' >/dev/null; then 85 | PRG="$link" 86 | else 87 | PRG="$(dirname "$PRG")/$link" 88 | fi 89 | done 90 | 91 | saveddir=$(pwd) 92 | 93 | M2_HOME=$(dirname "$PRG")/.. 94 | 95 | # make it fully qualified 96 | M2_HOME=$(cd "$M2_HOME" && pwd) 97 | 98 | cd "$saveddir" 99 | # echo Using m2 at $M2_HOME 100 | fi 101 | 102 | # For Cygwin, ensure paths are in UNIX format before anything is touched 103 | if $cygwin; then 104 | [ -n "$M2_HOME" ] && 105 | M2_HOME=$(cygpath --unix "$M2_HOME") 106 | [ -n "$JAVA_HOME" ] && 107 | JAVA_HOME=$(cygpath --unix "$JAVA_HOME") 108 | [ -n "$CLASSPATH" ] && 109 | CLASSPATH=$(cygpath --path --unix "$CLASSPATH") 110 | fi 111 | 112 | # For Mingw, ensure paths are in UNIX format before anything is touched 113 | if $mingw; then 114 | [ -n "$M2_HOME" ] && 115 | M2_HOME="$( ( 116 | cd "$M2_HOME" 117 | pwd 118 | ))" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="$( ( 121 | cd "$JAVA_HOME" 122 | pwd 123 | ))" 124 | fi 125 | 126 | if [ -z "$JAVA_HOME" ]; then 127 | javaExecutable="$(which javac)" 128 | if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then 129 | # readlink(1) is not available as standard on Solaris 10. 130 | readLink=$(which readlink) 131 | if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then 132 | if $darwin; then 133 | javaHome="$(dirname \"$javaExecutable\")" 134 | javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac" 135 | else 136 | javaExecutable="$(readlink -f \"$javaExecutable\")" 137 | fi 138 | javaHome="$(dirname \"$javaExecutable\")" 139 | javaHome=$(expr "$javaHome" : '\(.*\)/bin') 140 | JAVA_HOME="$javaHome" 141 | export JAVA_HOME 142 | fi 143 | fi 144 | fi 145 | 146 | if [ -z "$JAVACMD" ]; then 147 | if [ -n "$JAVA_HOME" ]; then 148 | if [ -x "$JAVA_HOME/jre/sh/java" ]; then 149 | # IBM's JDK on AIX uses strange locations for the executables 150 | JAVACMD="$JAVA_HOME/jre/sh/java" 151 | else 152 | JAVACMD="$JAVA_HOME/bin/java" 153 | fi 154 | else 155 | JAVACMD="$(which java)" 156 | fi 157 | fi 158 | 159 | if [ ! -x "$JAVACMD" ]; then 160 | echo "Error: JAVA_HOME is not defined correctly." >&2 161 | echo " We cannot execute $JAVACMD" >&2 162 | exit 1 163 | fi 164 | 165 | if [ -z "$JAVA_HOME" ]; then 166 | echo "Warning: JAVA_HOME environment variable is not set." 167 | fi 168 | 169 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 170 | 171 | # traverses directory structure from process work directory to filesystem root 172 | # first directory with .mvn subdirectory is considered project base directory 173 | find_maven_basedir() { 174 | 175 | if [ -z "$1" ]; then 176 | echo "Path not specified to find_maven_basedir" 177 | return 1 178 | fi 179 | 180 | basedir="$1" 181 | wdir="$1" 182 | while [ "$wdir" != '/' ]; do 183 | if [ -d "$wdir"/.mvn ]; then 184 | basedir=$wdir 185 | break 186 | fi 187 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 188 | if [ -d "${wdir}" ]; then 189 | wdir=$( 190 | cd "$wdir/.." 191 | pwd 192 | ) 193 | fi 194 | # end of workaround 195 | done 196 | echo "${basedir}" 197 | } 198 | 199 | # concatenates all lines of a file 200 | concat_lines() { 201 | if [ -f "$1" ]; then 202 | echo "$(tr -s '\n' ' ' <"$1")" 203 | fi 204 | } 205 | 206 | BASE_DIR=$(find_maven_basedir "$(pwd)") 207 | if [ -z "$BASE_DIR" ]; then 208 | exit 1 209 | fi 210 | 211 | ########################################################################################## 212 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 213 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 214 | ########################################################################################## 215 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 216 | if [ "$MVNW_VERBOSE" = true ]; then 217 | echo "Found .mvn/wrapper/maven-wrapper.jar" 218 | fi 219 | else 220 | if [ "$MVNW_VERBOSE" = true ]; then 221 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 222 | fi 223 | if [ -n "$MVNW_REPOURL" ]; then 224 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 225 | else 226 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 227 | fi 228 | while IFS="=" read key value; do 229 | case "$key" in wrapperUrl) 230 | jarUrl="$value" 231 | break 232 | ;; 233 | esac 234 | done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 235 | if [ "$MVNW_VERBOSE" = true ]; then 236 | echo "Downloading from: $jarUrl" 237 | fi 238 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 239 | if $cygwin; then 240 | wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") 241 | fi 242 | 243 | if command -v wget >/dev/null; then 244 | if [ "$MVNW_VERBOSE" = true ]; then 245 | echo "Found wget ... using wget" 246 | fi 247 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 248 | wget "$jarUrl" -O "$wrapperJarPath" 249 | else 250 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 251 | fi 252 | elif command -v curl >/dev/null; then 253 | if [ "$MVNW_VERBOSE" = true ]; then 254 | echo "Found curl ... using curl" 255 | fi 256 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 257 | curl -o "$wrapperJarPath" "$jarUrl" -f 258 | else 259 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 260 | fi 261 | 262 | else 263 | if [ "$MVNW_VERBOSE" = true ]; then 264 | echo "Falling back to using Java to download" 265 | fi 266 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 267 | # For Cygwin, switch paths to Windows format before running javac 268 | if $cygwin; then 269 | javaClass=$(cygpath --path --windows "$javaClass") 270 | fi 271 | if [ -e "$javaClass" ]; then 272 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Compiling MavenWrapperDownloader.java ..." 275 | fi 276 | # Compiling the Java class 277 | ("$JAVA_HOME/bin/javac" "$javaClass") 278 | fi 279 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 280 | # Running the downloader 281 | if [ "$MVNW_VERBOSE" = true ]; then 282 | echo " - Running MavenWrapperDownloader.java ..." 283 | fi 284 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 285 | fi 286 | fi 287 | fi 288 | fi 289 | ########################################################################################## 290 | # End of extension 291 | ########################################################################################## 292 | 293 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 294 | if [ "$MVNW_VERBOSE" = true ]; then 295 | echo $MAVEN_PROJECTBASEDIR 296 | fi 297 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 298 | 299 | # For Cygwin, switch paths to Windows format before running java 300 | if $cygwin; then 301 | [ -n "$M2_HOME" ] && 302 | M2_HOME=$(cygpath --path --windows "$M2_HOME") 303 | [ -n "$JAVA_HOME" ] && 304 | JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") 305 | [ -n "$CLASSPATH" ] && 306 | CLASSPATH=$(cygpath --path --windows "$CLASSPATH") 307 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 308 | MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") 309 | fi 310 | 311 | # Provide a "standardized" way to retrieve the CLI args that will 312 | # work with both Windows and non-Windows executions. 313 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 314 | export MAVEN_CMD_LINE_ARGS 315 | 316 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 317 | 318 | exec "$JAVACMD" \ 319 | $MAVEN_OPTS \ 320 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 321 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 322 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 323 | -------------------------------------------------------------------------------- /thymeleaf-demo/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /thymeleaf-demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.4.0 9 | 10 | 11 | com.codegate 12 | demo 13 | 0.0.1-SNAPSHOT 14 | thymeleaf 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-thymeleaf 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-web 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-test 34 | test 35 | 36 | 37 | 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-maven-plugin 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/main/java/com/codegate/demo/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.codegate.demo; 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 index(){ 11 | return "index"; 12 | } 13 | 14 | @RequestMapping("/blog") 15 | public String page2(){ 16 | return "blog"; 17 | } 18 | 19 | @RequestMapping("/contact") 20 | public String page3(){ 21 | return "contact"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/main/java/com/codegate/demo/ThymeleafApplication.java: -------------------------------------------------------------------------------- 1 | package com.codegate.demo; 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 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/main/resources/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |
9 | Home - Blog - Contacto 10 |
11 |
Todos os direitos reservados 2020
12 | 13 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/main/resources/templates/blog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 |
9 |

Blog Page

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/main/resources/templates/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Contacto 6 | 7 | 8 |
9 |

Entre em contacto

10 |
11 | 12 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index 6 | 7 | 8 |
9 |

Index Page

10 |
11 | 12 | -------------------------------------------------------------------------------- /thymeleaf-demo/src/test/java/com/codegate/demo/ThymeleafApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.codegate.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ThymeleafApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /thymeleaf-demo/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /thymeleaf-demo/target/classes/com/codegate/demo/HomeController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/thymeleaf-demo/target/classes/com/codegate/demo/HomeController.class -------------------------------------------------------------------------------- /thymeleaf-demo/target/classes/com/codegate/demo/ThymeleafApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/thymeleaf-demo/target/classes/com/codegate/demo/ThymeleafApplication.class -------------------------------------------------------------------------------- /thymeleaf-demo/target/classes/templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |
9 | Home - Blog - Contacto 10 |
11 |
Todos os direitos reservados 2020
12 | 13 | -------------------------------------------------------------------------------- /thymeleaf-demo/target/classes/templates/blog.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog 6 | 7 | 8 |
9 |

Blog Page

10 |
11 | 12 | 13 | -------------------------------------------------------------------------------- /thymeleaf-demo/target/classes/templates/contact.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Contacto 6 | 7 | 8 |
9 |

Entre em contacto

10 |
11 | 12 | -------------------------------------------------------------------------------- /thymeleaf-demo/target/classes/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Index 6 | 7 | 8 |
9 |

Index Page

10 |
11 | 12 | -------------------------------------------------------------------------------- /thymeleaf-demo/target/test-classes/com/codegate/demo/ThymeleafApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tmpvnunes/curso-spring-boot/133c17d9380a98876234d17fda74806a655b47a9/thymeleaf-demo/target/test-classes/com/codegate/demo/ThymeleafApplicationTests.class -------------------------------------------------------------------------------- /thymeleaf-demo/thymeleaf-demo.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 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 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | --------------------------------------------------------------------------------