STS4 설치
카테고리 없음 2019. 5. 27. 10:28STS 다운로드 https://spring.io/tools
디렉토리에 옮기기 (C:\sts-4.2.2.RELEASE)
STS 실행
STS 4에서 Spring Legacy Project를 지원하지 않으므로 Eclipse Marketplace에서 Spring Tools 3 Add-On 3.9.8 추가 설치
Help> Eclipse Marketplace "spring"검색
프로젝트 기본설정
기본 인코딩 utf-8로 변경
html/css/jsp 인코딩 utf-8로 변경
jsp 페이지의 템플릿 변경
Window > Preference
General - Workspace -Text File encoding
Editor - Text Editors - Spelling
Web - CSS Files - Encoding : ISO 10646/Unicode(UTF-8)
Web - HTML Files - Encoding : ISO 10646/Unicode(UTF-8)
Spring Legacy Project 에서는 jsp가 기본이 아니기 때문에 따로 설치 해줘야 한다.
Help > Install New Software
https://download.eclipse.org / releases
"java web" 검색
Eclipse Java Web Developer Tools 설치
Window > Preference > Web JSP file 인코딩을 UTF-8로 설정
https://youtu.be/KkMlhnEI9ds?list=PLY9pe3iUjRrRiJeg0jw22yW1G5yzAdiqC
JSP템플릿 편집
Window - Preferences -Web -JSP Files - Editor - Templates -New JSP File(html) 선택후 - Edit클릭
DOCTYPE을 HTML 4.01이라면 HTML5형식으로 변경
Get방식의 한글 데이터 처리 (tomcat 구버전)
C:\apache-tomcat-9.0.17\conf\Server.xml 편집
URIEncoding="utf-8"속성 2군데 추가
Spring sample 프로젝트를 다운받고 압축을 푼뒤 import
http://mannaedu.com/bbs/board.php?bo_table=pds&wr_id=74
spring01프로젝트 생성
Spring Legacy Progject => Spring MVC Project
패키지명 : com.example.spring01
메이븐 라이브러리 : 사용자/.m2 디렉토리 확인
jdk버전 수정 : Project Facets, Java compiler 버전 확인
spring 버전 변경 : pom.xml 수정 Spring sample 프로젝트를 다운받고 압축을 푼뒤 import
http://mannaedu.com/bbs/board.php?bo_table=pds&wr_id=74
import projects - General - Existing Projects into Workspace
(Maven)메이븐
1. Maven은 무엇인가?
Maven은 자바 프로젝트의 빌드(build)를 자동화 해주는 빌드 툴(build tool)이다.
즉, 자바 소스를 compile하고 package해서 deploy하는 일을 자동화 해주는 것이다.
출처 : https://jeong-pro.tistory.com/168
https://mvnrepository.com/artifact/org.springframework/spring-context
spring frame 버전 : 현업에서는 3버전을 아직 많이 쓰기는 하지만 최신 버전으로 학습 현재 최신버전 (2019.05월 기준 : 5.1.7.RELEASE)
동강에서는 5.1.4.RELEASE
저장 위치
C:\Users\smilejsu\.m2\repository
필요하다면 검색해서 추가 하면 됨.\
mysql를 추가해보겠음.
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.13
새 프로젝트를 만들어 보겠음
spring01프로젝트 생성
Spring Legacy Progject => Spring MVC Project
패키지명 : com.example.spring01
메이븐 라이브러리 : 사용자/.m2 디렉토리 확인
jdk버전 수정 : Project Facets, Java compiler 버전 확인
spring 버전 변경 : pom.xml 수정
한글 깨짐
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page session="false" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Home</title>
</head>
<body>
<h1>
Hello world!
</h1>
<P> The time on the server is ${serverTime}. </P>
</body>
</html>
|