Web/Spring

spring framework 설치 및 환경설정 (spring legacy project/tomcat)

dev_sr 2020. 9. 16. 17:04

 

 

Spring Tools 4 is the next generation of Spring tooling

Largely rebuilt from scratch, Spring Tools 4 provides world-class support for developing Spring-based enterprise applications, whether you prefer Eclipse, Visual Studio Code, or Theia IDE.

spring.io

여기서 STS 4 다운로드

 

workspace 경로 설정 후 Help -> Eclipse Market 에서 Spring Tools 3를 설치해줌

 

 

 

Window -> Preference

General -> workspace 에서 인코딩을 utf-8로 바꿔줌

 

Web -> CSS, HTML에서도 UTF-8로 변경

 

 

 

jsp를 설정해줘야함

Help -> install new software

 

https://download.eclipse.org/releases/2019-03 

이런 식으로 링크를 만들어서 work with에 적어줌

 

type web에는 java web 적어줌

 

맨위에 나오는 Eclipse java web developer tools 선택해서 설치

 

설치하면 jsp도 UTF-8로 인코딩을 바꿔줌

 

 

 

 

Tomcat 설치

 

Tomcat 8.5 버전을 설치해줌 

 

Apache Tomcat® - Apache Tomcat 8 Software Downloads

Welcome to the Apache Tomcat® 8.x software download page. This page provides download links for obtaining the latest versions of Tomcat 8.x software, as well as links to the archives of older releases. Unsure which version you need? Specification versions

tomcat.apache.org

STS4에 톰캣 설치 방법

 

[Spring] Spring 설치방법, 톰캣 서버 연결, 디렉토리 구조

* Spring 이란?에 대한 포스팅 : http://jerryjerryjerry.tistory.com/62 * Spring 설치 방법 1. 첫번째 설치방법으로는 이클립스 안에서 STS 플러그인을 설치하는 방법이 있다. 2. 두번째 설치방법으로는 이클립..

jerryjerryjerry.tistory.com

 

 

설치 후 Tomcat admin port에 port number가 있는 지 확인

없으면 뭘해도 서버가 작동하지 않음

 

 

 

스프링 레거시 프로젝트 만들기

 

마우스 우클릭 -> New -> Other -> spring legacy project 

 

프로젝트 이름을 적어주고

spring MVC Project 를 선택해줌 

 

패키지 이름을 예시대로 com.ddddd.aaa 이런식으로 적어주는데

마지막 aaa가 path가 됨

ex) http://localhost:8080/aaa

 

 

서버 탭에서 서버를 우클릭

 

 

Add and Remove에 들어가면 서버에서 돌릴 프로젝트를 설정할 수 있음

 

제대로 설정 되었다면

http://localhost:8080/패키지 이름 맨 마지막

을 입력하면 Hello world가 출력됨

 

STS4에 저 브라우저 창이 안보일 때

Window -> Show view -> Other -> General -> Internal Web Browser 

 

 

8080 포트에서 다른 서버가 돌아가서 Tomcat이 실행되지 않을 때

 

cmd ->관리자 권한으로 실행 (아니면 엑세스 접근 불가 나올 수도 있음)

 

특정 번호 포트 확인 :   netstat -ano | grep "8080" 

특정 번호 포트 종료 :   taskkill /F /PID 번호