Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- github
- 기업설명회
- SQL
- 깃허브
- SQLD
- java
- spring
- myBatis
- Spring Security
- 배포
- error
- 김영한
- CSS
- 자바
- 티스토리챌린지
- 스파르타코딩클럽
- 코딩
- JavaScript
- restapi
- 오블완
- jQuery
- vscode
- 웹개발
- Eclipse
- 이클립스
- bootstrap
- ChatGPT
- HTML
- AJAX
- Firebase
Archives
- Today
- Total
푸들푸들
1030 Spring 기본 본문
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HelloController {
@GetMapping("/hello")
public String hello() {
return "a";
}
}
∆ ∇ 같은 의미
@WebServlet("/hello")
public class FrontServlet extends HttpServlet{
void doget(request,response) {
String s = this.hello(reqeust,response);
RequestDispatcher(prifix + s + seffix).forward(request,response);
}
String hello(request,response) {
return "a";
}
}
prifix + s + seffix == /WEB-INF/view/a.jsp
Mybatis XML Mapper -> 쿼리 파일
- 원래 interface 파일 하나로 사용 가능하지만 쿼리가 길어지면 가독성이 떨어져 쿼리만 입력하는 파일을 따로 만든 것
- namespace: interface 이름
- resultType: 반환타입
<mapper namespace="com.example.sakila.mapper.CountryMapper">
<select id="selectCountryList" resultType="com.example.sakila.vo.Country">
SELECT
country_id countryId
, country
,last_update lastUpdate
FROM country
</select>
</mapper>
* xml 오류 날때 - 그냥 버그
- 파일 만들자마자 오류나는건 버그일 가능성 높음
- 파일 고치는건 웬만하면 안하는 쪽으로
체크했다가 다시 풀어보기
* 디폴트 브라우저 바꾸기
Window > Preferenses > Web Browser
* jsp 파일 templates 수정
Window > Preferenses > JSP files > Templates
- Name : New JSP File(html 5)
<%@ page language="java" contentType="text/html; charset=${encoding}" pageEncoding="${encoding}"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<meta charset="${encoding}">
<title></title>
</head>
- taglib,bootstrap, jquery CDN 추가
'구디아카데미 > JAVA' 카테고리의 다른 글
1101 [Sakila] staffOne (2) | 2024.11.01 |
---|---|
1101 [Sakila]로그아웃, 유효성 검사 (3) | 2024.11.01 |
1031 [Sakila] Spring 로그인 (1) | 2024.11.01 |
1031 Github Token 발급, Commit, Push, 내려받기 (0) | 2024.10.31 |
1030 Spring 세팅 (2) | 2024.10.30 |