โข
tomcat 10 ์ค์น
โข
intellij์์ java, maven ํ๋ก์ ํธ ์์ฑ
โข
github์ ์๋ก์ด repo๋ง๋ค๊ณ ์ฐ๊ฒฐ
โข
.gitignore์ถ๊ฐ(intellij์์ ์ง์ ์์ฑํ์ง ์์ผ๋ฉด ์ธ์์ด ์ ๋๋ ์ค๋ฅ๊ฐ ์์์)
โฆ
gitignore.io์์ java, maven, intellij ํค์๋๋ก ์์ฑํ์ฌ ๋ณต๋ถ ๋๋ echo๋ก ์์ฑ
git init
git remote add origin https://github.com/sgcs11/tomcat_exam.git
echo ".idea" >> .gitignore
echo "target" >> .gitignore
git add .
git commit -m "์ธํ
"
git push origin master
Shell
๋ณต์ฌ
โข
tomcat 10 ๋ฒ์ ๋ถํฐ๋ ์ฌ์ฉ์ ์ํด์ jakarta ๋ํ๋์ ์ถ๊ฐ ํ์
<dependencies>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
XML
๋ณต์ฌ
โข
src/main์ webapp ํด๋ ์ถ๊ฐ
โฆ
index.html ์์ฑํ์ฌ http://localhost:8080์์ ์ ๋จ๋์ง ํ์ธ
โข
src/main/java์์ HelloServlet.java ์์ฑํ๊ณ @WebServlet("/hello")์ผ๋ก Servlet ์์ฑ