반응형 Programing/Springboot39 springboot form, ajax 데이터 타입별 Controller에서 받는 방법 @RequestParam, @RequestBody springboot form, ajax 데이터 타입별 Controller에서 받는 방법 @RequestParam, @RequestBody 이번 포스팅에서는 springboot web project에서 form 과 ajax로 자주 사용되는 데이터타입을 전송하고 받는 방법을 정리해보도록 하겠습니다. 1. Form data request로 받기 [HTML] [Controller - 받을 수는 있지만 Request로 받는 방식은 GET Method에서만 사용합니다.] @RequestMapping(value="sendForm.getRequest", method=RequestMethod.POST) public String getRequest(HttpServletRequest req) { System.out.prin.. Programing/Springboot 2021. 11. 1. springboot application.properties server.error 설정 ErrorController springboot application.properties server.error 설정 ErrorController springboot의 에러 설정에 대해 알아보겠습니다. springboot 에러 설정은 기본 설정파일인 application.properties 파일에서 간단히 할 수 있습니다. server.error.path : 에러발생 시 전달 할 경로 (default : /error) server.error.include-exception : 응답에 exception을 포함할지 여부 (default : false) server.error.include-stacktrace : 응답에 stacktrace를 포함할지 여부 (default : never) server.error.whitelabel.enab.. Programing/Springboot 2021. 10. 22. Spring boot 2.x apache tiles 적용 방법 Spring boot 2.x apache tiles 적용 방법 Springboot 2.x 에서 apache tiles를 적용하는 방법을 알아보도록 하겠습니다. apache tiles 는 페이지의 레이아웃을 보다 편하고 보기좋은 코드를 만드는데 도움을 줍니다. 예를들어 header와 footer가 모든 페이지에 들어간다고 했을때, apache tiles를 사용하지 않으면 각각의 페이지마다 include를 사용하여 추가해야 했습니다. . . (페이지 코드) . 하지만 tiles를 사용하게 되면 각 페이지에 include를 하지 않아도 됩니다. 그럼 spring boot 2.x 에 적용하는 방법을 알아보겠습니다. 의존성 주입 도구는 gradle 입니다. maven이나 기타 다른 의존성 도구는 아래의 링크를 확.. Programing/Springboot 2021. 8. 17. Springboot gradle 프로젝트 내장 톰캣 메모리 세팅 방법 Springboot gradle 프로젝트 내장 톰캣 메모리 세팅 방법 Spring project의 톰캣 메모리 세팅 방법은 아래의 Link를 확인하세요. aljjabaegi.tistory.com/218 톰캣 Tomcat 메모리설정 java.lang.OutOfMemoryError : PermGen space 에러 톰캣 Tomcat 메모리설정 java.lang.OutOfMemoryError : PermGen space 에러 개발을 한 후 서버에 올려 톰캣을 실행하다 보면 위와 같은 에러를 볼수 있다. PermGen space 는 Class, Method 등이 저장되는 영역으.. aljjabaegi.tistory.com gradle 프로젝트 내장 톰캣의 메모리 설정은 Eclipse의 Run Configurat.. Programing/Springboot 2021. 4. 19. Java Properties load, store example 읽고 수정 Java Properties load, store example 읽고 수정 Spring boot 의 설정파일인 .properties 파일에 접근하여 내용을 읽고 수정하고 저장하는 방법을 알아보도록 하겠습니다. 샘플 코드를 보시죠. import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Properties; import org.springframework.context.annotation.Bean; import org.spring.. Programing/Springboot 2020. 8. 21. spring boot 2.x interceptor setting 스프링부트 인터셉터 등록 방법 spring boot 2.x interceptor setting 스프링부트 인터셉터 등록 방법 이번 포스팅에서는 spring boot 프로젝트에 인터셉터를 등록하는 방법을 알아보겠습니다. 간단히 순서만 우선 말씀드리면, 1. HandlerInterceptorAdapter extends 받은 실제 interceptor 구현 class 생성. 2. WebMvcConfigurer을 implements 받은 WebMvcConfig class 생성 후 1의 interceptor 등록. 의 순 입니다. ※ 2021.12.15 추가 Spring 버전 때문에 HandlerInterceptorAdaptor 가 deprecated 되었다면 (취소선) HandlerInterceptor 를 implements 하도록 합니다... Programing/Springboot 2020. 7. 14. spring boot 서버 재시작 없이 정적 리소스 적용 방법 spring boot 서버 재시작 없이 정적 리소스 적용 방법 spring boot starter web 으로 작업을 하면, 정적인 소스 (jsp, css, image, html) 등을 수정하면 바로 적용이 되지 않습니다. 서버를 재시작 해야 적용이 되죠. 이런 불편함을 제거해주는 게 spring boot devtools 입니다. 간단히 의존성을 주입하고 application.properties 에 적용만 해주면 되죠. 1. 의존성 주입 [Gradle] compile group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.2.1.RELEASE' [Maven] org.springframework.boot spring-boot.. Programing/Springboot 2019. 12. 5. Spring boot 2.x SMTP send mail tutorial, 메일 보내기 java Spring boot 2.x SMTP send mail tutorial, 메일 보내기 java windows server 에 SMTP 세팅하는 방법은 아래의 Link를 참고하세요. Link : [Window server]How to set up SMTP mail Server 메일서버 세팅 방법 다른 로직은 제외하고 메일보내는 코드만 정리하였습니다. 참고바랍니다. 메일을 보내기 위해서는 spring-boot-starter-mail 의 의존성 주입이 필요합니다. [Gradle] // https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-mail compile group: 'org.springframework.boot',.. Programing/Springboot 2019. 12. 2. springboot 2.x gradle 웹프로젝트 db mybatis 연동 설정 데이터베이스 연동 springboot 2.x gradle 웹프로젝트 db mybatis 연동 설정 데이터베이스 연동 웹프로젝트 기본 설정은 아래의 Link 를 참고하세요. Link : springboot 2.x gradle jsp 연동 설정 웹프로젝트 생성 mybatis를 연동하기 위한 의존성 주입을 해줍니다. /*mybatis*/ compile group: 'org.mybatis.spring.boot', name: 'mybatis-spring-boot-starter', version: '2.1.1' compile('org.springframework.boot:spring-boot-starter-jdbc') refresh gradle 후 mybatis config 파일을 생성해줍니다. import javax.sql.Dat.. Programing/Springboot 2019. 11. 19. springboot 2.x jsp 연동 설정 웹프로젝트 생성 springboot 2.x jsp 연동 설정 웹프로젝트 생성 springboot 를 활용하여 jsp를 연동하여 web project 설정을 하는 방법을 알아보도록 하겠습니다. springboot 프로젝트 생성은 아래의 Link를 참고하세요. Link : Eclipse Spring boot Gradle 프로젝트 간단 생성 방법 첫번째로, 웹 프로젝트를 생성하는데 필요한 의존성 주입을 해줍니다. build.gradle > dependencies 쪽에 추가 /*web*/ compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.0.RELEASE' /*jstl*/ compile group: 'jstl', na.. Programing/Springboot 2019. 11. 19. Springboot RESTFul API 서버 20분만에 환경설정 끝내기 Springboot RESTFul API 서버 20분만에 환경설정 끝내기 보다 쉽고! 보다 간편하게! RESTFul API 환경을 설정해보겠습니다. Java Version : 1.8 Springboot Version : 2.2.1 DB Version : Oracle 12c 우선 Springboot Gradle 프로젝트 생성은 아래의 Link를 참고하세요. Link : Eclipse Spring boot Gradle 프로젝트 간단 생성 방법 Eclipse Spring boot Gradle 프로젝트 간단 생성 방법 Eclipse Spring boot Gradle 프로젝트 간단 생성 방법 원래는 간단 합니다. 이클립스 좌측 Project Explorer 에서 오른쪽 마우스 클릭. New > Other... >.. Programing/Springboot 2019. 11. 8. Springboot application.properties 정리 Springboot application.properties 정리 Springboot application.properties 복잡하게 구현해야 하는 설정을 간편하게 할 수 있게끔 기능을 제공합니다. DB 부터 자주사용되는 라이브러리들에 대한 설정까지 다양하게 제공을 하고 있는데요, 그 종류에는 어떤 것들이 있는지 자주 사용되는 설정에 대해서 알아보겠습니다. 참고 : https://docs.spring.io/spring-boot/docs/2.0.x/reference/html/common-application-properties.html Appendix A. Common application properties Appendix A. Common application properties Various pro.. Programing/Springboot 2019. 11. 7. Springboot + Actuator 연동방법, 어플리케이션 모니터링 Springboot + Actuator 연동방법, 어플리케이션 모니터링 springboot 어플리케이션에 대해 모니터링 할 수 있는 라이브러리인 Actuator 적용방법에 대해 알아보도록 하겠습니다. 기본적인 springboot 어플리케이션 생성방법은 아래의 Link를 확인하세요. Link : Eclipse Spring boot Gradle 프로젝트 간단 생성 방법 Eclipse Spring boot Gradle 프로젝트 간단 생성 방법 Eclipse Spring boot Gradle 프로젝트 간단 생성 방법 원래는 간단 합니다. 이클립스 좌측 Project Explorer 에서 오른쪽 마우스 클릭. New > Other... > Spring > Spring Starter Project 선택. 해서 버전.. Programing/Springboot 2019. 11. 7. Springboot Actuator Endpoint 정리 Springboot Actuator Endpoint 정리 endpoint ID 설명 self Actuator 출력 정보를 출력한다. beans 어플리케이션에 있는 모든 bean 의 목록을 출력한다. caches 사용 가능한 캐시를 출력한다. conditions 자동 구성된 클래스에서 평가 된 조건과 해당 클래스가 일치하거나 일치하지 않는 이유를 출력한다. configprops 모든 @Configuation 어노테이션 설정 정보를 표출한다. env Spring의 환경설정 정보를 표출한다. health 어플리케이션 상태정보를 표출한다. info 임의 어프리케이션 정보를 표출한다. loggers 어플리케이션의 로거 구성을 표출한다. metrics 어플리케이션의 metric 정보를 표출한다. scheduledt.. Programing/Springboot 2019. 11. 7. Springboot + mybatis 연동 시 Type Exception 해결방법 Springboot + mybatis 프로젝트 배포시 Type Exception 해결방법 SpringBoot Version : 2.2.1 Mybatis Version : 1.3.2 Eclipse 에서는 이상 없이 동작하던 프로젝트가 Jar 파일로 배포 하면 아래와 같은 Exception이 발생했습니다. Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'regionVO'. Cause: java.lang.ClassNotFoundException: Cannot find class: regionVO at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasReg.. Programing/Springboot 2019. 10. 24. 이전 1 2 3 다음 💲 추천 글 반응형