본문 바로가기

분류 전체보기375

spring boot oauth2.0 Postman 에서 토큰 요청 , refresh 요청 하는 방법 리프레시 토큰 요청 oauth2.0 기반 로그인 구현 강의를 녹화하고 싶은 마음이 있었습니다. ( 소셜로그인과는 다릅니다. 스프링 시큐리티에 있는 것을 이용합니다.) 그런데 수요가 있을지 의문이라서 고민중입니다. 얼마나 수요가 있는지 알아보고 진행하려고 하니 강의가 필요한 분은 댓글에 말씀해주세요. 2018. 12. 12.
스프링부트 spring boot json 리턴 하는 방법 123456789101112@Controllerpublic class HomeController { @ResponseBody @GetMapping("/") public Map jsonReturnSample(){ Map map = new HashMap(); map.put("name", "111"); map.put("age", "2222"); return map; }}Colored by Color Scriptercs 함수 위에 @ResponseBody 애너테이션을 붙인다. 그리고 리턴 타입을 map으로 설정한다 그러면 아래와 같이 json으로 리턴된다. 2018. 12. 11.
AWS RDS Mysql 한글 깨짐 처리 utf-8 설정 AWS 를 사용해서 호스팅을 할 때 RDS 데이터베이스를 사용하는 경우가 있다. RDS 무료일때 20GB 까지 제공해준다. 그런데 인코딩을 UTF-8로 설정을 안하면 한글이 들어갈 수 없다. 설정 방법은 이렇다. 파라미터 그룹을 생성한다. 생성을 클릭한다. 생성 후 편집을 시작한다. 파라미터를 편집합니다. character 라고 적힌 항목은 모두 utf-8 로 변경한다. collation_connection 과 collation_server 도 utf-8로 변경한다. DB를 만들때도 UTF-8을 작성한다. create table comments( comment_id bigint not null primary key, comment_content varchar(255), comment_level int, .. 2018. 12. 2.
스프링 부트 타임리프 img 태그 파일 경로 인식 123456789101112131415 @SpringBootApplicationpublic class Pilotmysql22Application extends SpringBootServletInitializer{ public static void main(String[] args) { SpringApplication.run(Pilotmysql22Application.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // TODO Auto-generated method stub return builder.sources(Pilotmysql22Application.cla.. 2018. 11. 29.
스프링 부트 글 업데이트 하는 방법 Long commentId = Long.parseLong(request.getParameter("comment_id")); // 글 id String commentContent = request.getParameter("content"); // 글 id로 1개 찾기 Comments comments = commentsRepository.getOne(commentId); //1개 찾아서 저장 comments.setComment_content(commentContent); // 내용 변경 commentsRepository.save(comments); //아까 찾은 객체를 다시 save 이러면 update가 된다. 2018. 11. 28.