- 9-10
https://hongeui.tistory.com/13
JSP 파일 생성 직후 에러(The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path)
여기서 정정*
톰캣서버를 클래스패스에 만들어줘야함
zip로 export가능(하지만 용량 너무 커질 수 있어 비추!)
프로젝트 우클릭 > Export > Export ... > General의 Archive File 선택 후 Next > 위치 지정 후 zip로 저장
import할때는 General > Existing Projects into Workspace > Select archive file로 불러오기
import > Gradle Project
- 10-11
/springWeb03/src/main/resources/application.properties
https://tomcat.apache.org/tomcat-10.0-doc/jndi-datasource-examples-howto.html#Oracle_8i,_9i_&_10g
1. Context configuration
<Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@127.0.0.1:1521:mysid"
username="scott" password="tiger" maxTotal="20" maxIdle="10"
maxWaitMillis="-1"/>
POJO란? (Plain Old Java Object)
특정 '기술'에 종속되어 동작하는 것이 아닌 순수한 자바 객체
http://cod2022.tistory.com/136
http://mybatis.org/spring/
http://mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/
- 11-12
http://mybatis.org/spring/sqlsession.html
SqlSessionTemplate is the heart of MyBatis-Spring
- 12-1
Build 패턴
이너클래스를 이용하여 안에 객체를 만드는 것..?
https://readystory.tistory.com/121
- 2-3
프로젝트 우클릭 > Team > Share > finish
Git Staging 탭에서 build.gradle, src를 Staged Changes에 넣어주고 Commit Message 작성 후 Commit (패키지, 폴더 안에 파일 없으면 export시 아예 없어짐! 유의해 특히 src/main/resources의 빈 패키지, 폴더들 ex. sqlmap, templates, static)
Git Repositories 탭에서 Branches> Local에 master생김
깃 사이트 레포지토리 복사 후 master 우클릭 > push branch 하면 복사한 주소로 자동 반영됨
> User 깃아이디, password는 토큰 입력 (3회) (비밀번호 저장은 하지마세요 위험)
불러오는 방법
깃 사이트 레포지토리 복사 후 Git Repositories 탭에서 Clone 하고 저장소 지정해주면 Git Repositories에 생성됨
임포트 > Gradle Project 누르고 디렉토리 지정해주면 끝
프로젝트 우클릭 > Gradle > Refresh 한번해주고 테스트 파일 잘 되는지 실행해봐
templates에는 자바파일이 아닌 파일(ex. HTML)만 넣음
우클릭 > New > Other... > Web > HTML File > index.html 생성
E:\kdt\tools\eclipse\eclipse.ini
이클립스 세팅 정보
최소, 최대 메모리
-Xms1024m
-Xmx2048m
넘어가면 안되니까 프로젝트 끝나면 close 잘해놔~
깃 활용 잘해~
- 3-4
(index.html)(/springWeb04/src/main/resources/templates/index.html)
HTML
<a href="/board/list">게시판</a> : 여기서 시작하는 '/'가 곧 contextpath
<a> a태그는 요청 정보 : get
- 4-5
@Autowired 기능?
: 필요한 의존 객체의 '타입'에 해당하는 빈을 찾아 주입함(생성자, setter, 필드 이 세가지 경우에서 사용가능)
https://devlog-wjdrbs96.tistory.com/166
@RequiredArgsConstructor
final이 붙거나 @NotNull 이 붙은 필드의 생성자를 자동 생성해주는 롬복 어노테이션
(BoardController.java)
public String list(Model model) { //Model객체를 통해서 보관하면 페이지에서 확인 가능(request와 동일한 기능)
//Model : 페이지까지 데이터를 전달해주는 객체. 요청시 생성
- 5-6
Mybatis와 xml은 무슨 관계..?
The full set of features provided by MyBatis can be realized by using the XML based mapping language that has made MyBatis popular over the years.
https://mybatis.org/mybatis-3/getting-started.html#exploring-mapped-sql-statements
여기서 복사해와
(BoardMapper.java)(board-mapper.xml)
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.green.nowon.mapper.BoardMapper">
</mapper>
프록시? mapper?
https://www.thymeleaf.org/
https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#using-texts
<html xmlns:th="http://www.thymeleaf.org">
https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#using-theach
<tr th:each="prod : ${prods}">
inlining?
https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#inlining
https://opentutorials.org/course/1375/6759
'개발일기' 카테고리의 다른 글
학원 수업 41일차 221019 (0) | 2022.11.24 |
---|---|
학원 수업 40일차 221018 (0) | 2022.11.18 |
학원 수업 39일차 221017 (0) | 2022.11.18 |
학원 수업 38일차 221014 (0) | 2022.11.18 |
학원 수업 36일차 221012 (0) | 2022.10.31 |
학원 수업 35일차 221011 (0) | 2022.10.31 |
학원 수업 34일차 221007 (0) | 2022.10.31 |
학원 수업 33일차 221006 (0) | 2022.10.31 |
댓글