React 와 별도로 js 파일을 구현할 일이 생겼다.
1. Tomcat 설치
https://tomcat.apache.org/download-90.cgi#9.0.116
Apache Tomcat® - Apache Tomcat 9 Software Downloads
Welcome to the Apache Tomcat® 9.x software download page. This page provides download links for obtaining the latest version of Tomcat 9.0.x software, as well as links to the archives of older releases. Unsure which version you need? Specification version
tomcat.apache.org
2. Tomcat Webapps 폴더에 웹앱 폴더 만들기
"본인 경로\apache-tomcat-9.0.116\apache-tomcat-9.0.116\webapps"
3. js 파일 넣기
"본인 경로\apache-tomcat-9.0.116\apache-tomcat-9.0.116\webapps\testjs\testjs.jsp"
4. WEB-INF/web.xml 에 context-param 넣기
나는 js 파일에 몽땅 때려넣었기 때문에 생략함
5. Cmd 에서 JAVA_HOME 경로 설정
startup.bat 먼저 실행하면 아래 에러 발생
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
자바 다운로드
https://www.java.com/ko/download/
이때 경로는 bin 보단 상위경로에 둬야함.
$env:JAVA_HOME = "jdk 다운로드 경로"
나의 경우 이렇게 설정함. (자바 다운로드 시 따로 경로 변경안함)
env:JAVA_HOME = "C:\Program Files\Java\jre1.8.0_481"
6. Cmd 에서 Tomcat 실행
\apache-tomcat-9.0.116\apache-tomcat-9.0.116\bin> .\startup.bat
7. localhost 경로 접속
따로 설정안해주면 기본 8080 경로
http://localhost:8080/external-approve/testjs/testjs.jsp"
8. 종료는 shutdown.sh 실행