본문 바로가기

컴퓨터공부

일주일 프로젝트

by Life & study 2022. 3. 23.
반응형

코드스크립터

https://colorscripter.com/

 

톰캣 연결하기

 https://backendcode.tistory.com/60

 

스프링부트스트랩 무료템플릿 사이트

https://startbootstrap.com/theme/clean-blog-jekyll

 


 

https://spring.io/tools

에 가서 각자 맞는 윈도우버전으로 다운받고 반디집으로 압축풀기가능 ㅋ

 




 
 
could not lauch the product because the specified workspace cannot be created.
the specified workspace directory is either invaild or read-only.
 
지정된 작업영역을 생성할 수 없으므로 제품을 라우크할 수 없습니다.
지정된 작업영역 디렉토리가 비활성화되었거나 읽기 전용입니다.

 

C:\Program Files 파일에 sts 설치하려고하면 오류난다 조심해라 30분개고생하면서 오류적어놨다 

 


sts

휴지통



 



-startup

plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar

--launcher.library

plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.400.v20211117-0650

-product

org.springframework.boot.ide.branding.sts4

--launcher.defaultAction

openFile

-vm

plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.2.v20220201-1208/jre/bin

-vmargs

--add-opens=java.base/java.io=ALL-UNNAMED

--add-opens=java.base/sun.nio.ch=ALL-UNNAMED

--add-opens=java.base/java.net=ALL-UNNAMED

--add-opens=java.base/sun.security.ssl=ALL-UNNAMED

-Dosgi.requiredJavaVersion=11

-Dosgi.dataAreaRequiresExplicitInit=true

-Xms1024m <-----------바뀐부분

-Xmx2048m

--illegal-access=permit

--add-modules=ALL-SYSTEM

 

UTF-8  설정

 
 

 





 

 

SPRING 패키지 만들어보기~



 


SQL ORACLE 드라이브 추가했당

 

 



이 부분을 바꾸면 파일명과 패키지 명이 바뀐다.

Spring 설정부분
 
oracle driver
spring web
h2 database
spring data jpa
thymeleaf
mustache
 

 

서버 구동  !~ 첫시작

http://localhost:8080/

 
helloworld 출력해보기

 

 

의존성? pom.xml? 

pom.xml= maven추가 = 추가 옵션을 붙이는것으로  생각하면된다.=의존성

이다.

 

오류

400오류 진입점 경로 오류

500 서버 오류

resources폴더에 

member 폴더 만들어서 작동시켜보기

 
 
 

 



spring.thymeleaf.prefix=classpath:templates/thymeleaf/

폴더/파일 맵핑 고정주소라고 보면된다.

 

 


 

 

컨트롤러 @GetMapping 에 대한 이해


application.properties에

spring.thymeleaf.prefix=classpath:templates/thymeleaf/ 빨간줄표시

까지 맵핑주소 고정시켜논다.

 

노랑색이 그뒤에 파일위치를 적어서 맵핑주소를 만들고

@GetMapping("/member/add")이 사용자가 요청한 html의 주소

return "member/add"; 이 요청이 되고 받는 사용자주소

 


 

$표시로 컨트롤러에 적고 view 에 적고 해서 

데이터 값 보내고 불러오기

 

 

뷰단 모습
 
<!DOCTYPE html>
<html xmlns:th="http://thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>SamlpeController</title>
</head>
<body>
<h1>userinfo.html</h1>
<h1 th:text="${ username }"></h>

</body>
</html>
 
 

 


 
서버단 모습
 
package com.example.firstdemo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class SampleController1 {
@GetMapping("/user/userinfo")
public String userInfo() {
return "/user/userinfo";
}
@GetMapping("/user/userinfo")
public String userData( Model model ) {
model.addAttribute( "username","홍길동");
// 뷰페이지 단으로 같이 데이터(model) 전달
return "/user/userinfo";
}

 

출력값 표시 확인하기  주소입력에 다르게하여 다르게 출력되는것을 알수있다.



 
 
 
레이아웃을 구성하는 방법
 
 
컨트롤단
@GetMapping("/user/userid")
public String userId(@RequestParam("userid") String uid, Model model ) {
// 변수명 변수명, 모델로 넘기는값(뷰단에 보여지기위해 model 사용)

model.addAttribute("userid", uid );

return "/user/userinfo";
}

 
이부분에서 끝에 DB설정값을 적는다.
 
 
 
오라클 드라이버 설정값 참고하기
 
https://programmer93.tistory.com/24
 

Spring boot oracle db 연동 , spring boot oracle jdbc 설정 - 삽질중인 개발자

Spring boot에서 오라클 DB 연동하기 + Mybatis 설정하기 스프링 부트에서 oracle과 mybatis를 설정하는 방법입니다. spring boot oracle datasource를 설정하기 전에 필요한 jar 파일을 다운로드 합니다. 1. pom...

programmer93.tistory.com

 

스프링 서버 구성

 

 

 

]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

https://pinetools.com/syntax-highlighter 

 

Online Syntax highlighter

Syntax highlighting of pasted code

pinetools.com

코드사이트

 

DAO 데이터 접근 데이터 엑세스 오브젝트 =sqlsession템플릿  대체한다.

 

스프링 DB 프로젝트 

 

https://appsnuri.tistory.com/413 다시가보기  오라클 사이트 오류 설명

 

오라클

https://www.oracle.com/database/technologies/xe-prior-release-downloads.html

 

 

 

가로 =열과 레코드 = row 한줄과 같은뜻이다.

세로 = 필드 , 칼럼 라고 애기한다.

튜블 = 내용

 

실행-services.msc 

 

확인목록.

 

 

 

반응형

댓글