소개
게시글
질문&답변
2021.04.25
http://localhost:8080/request-param-v1
log .info( "username={},age={}" , username , age ); 답변감사드립니다 setting에서 idea 든 gradle 이든 jdk 11로 바꿔줫는데도 왜 15로 뜨는걸까요?
- 0
- 5
- 214
질문&답변
2021.04.24
http://localhost:8080/request-param-v1
@Slf4j @Controller public class RequestParamController { @RequestMapping ( "/request-param-v1" ) public void requestParamV1 ( HttpServletRequest request, HttpServletResponse response) throws IOException { String username = request.getParameter( "username" ); int age = Integer . parseInt (request.getParameter( "age" )); response.getWriter().write( "ok" ); } @ResponseBody @RequestMapping ( "/request-param-v2" ) public String requestParamV2 ( @RequestParam ( "username" ) String memberName, @RequestParam ( "age" ) int memberAge) { log .info( "username={}, age={}" , memberName, memberAge); return "ok" ; //@RestController 같은효과 } } # 전체 로그 레벨 설정 ( 기본 info) logging.level.root = info #hello.springmvc 패키지와 그 하위 로그 레벨 설정 logging.level.hello.springmvc = debug 2021-04-24 21:05:34.313 INFO 15380 --- [ main] hello.springmvc.SpringmvcApplication : Starting SpringmvcApplication using Java 15.0.2 on DESKTOP-C6Q38EP with PID 15380 (C:\study\springmvc\springmvc\out\production\classes started by 82109 in C:\study\springmvc\springmvc) 2021-04-24 21:05:34.317 DEBUG 15380 --- [ main] hello.springmvc.SpringmvcApplication : Running with Spring Boot v2.4.5, Spring v5.3.6 2021-04-24 21:05:34.318 INFO 15380 --- [ main] hello.springmvc.SpringmvcApplication : No active profile set, falling back to default profiles: default 2021-04-24 21:05:35.409 INFO 15380 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2021-04-24 21:05:35.421 INFO 15380 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2021-04-24 21:05:35.421 INFO 15380 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.45] 2021-04-24 21:05:35.515 INFO 15380 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2021-04-24 21:05:35.515 INFO 15380 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1132 ms 2021-04-24 21:05:35.915 INFO 15380 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2021-04-24 21:05:36.292 INFO 15380 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html] 2021-04-24 21:05:36.465 WARN 15380 --- [ main] ion$DefaultTemplateResolverConfiguration : Cannot find template location: classpath:/templates/ (please add some templates or check your Thymeleaf configuration) 2021-04-24 21:05:36.551 INFO 15380 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2021-04-24 21:05:36.563 INFO 15380 --- [ main] hello.springmvc.SpringmvcApplication : Started SpringmvcApplication in 2.734 seconds (JVM running for 3.135) 2021-04-24 21:06:19.710 INFO 15380 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2021-04-24 21:06:19.710 INFO 15380 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2021-04-24 21:06:19.712 INFO 15380 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms
- 0
- 5
- 214
질문&답변
2021.04.24
http://localhost:8080/request-param-v1
네 똑같이 ok만 뜹니다
- 0
- 5
- 214
질문&답변
2021.04.11
servletApplication.main()메소드가 게속 실행되는데 끝나질 안아요?
명확한 설명 감사드리고 한글은 다른방법으로 해결햇어요!!
- 0
- 3
- 1.7K
질문&답변
2021.03.22
Assertions. 에서 임포트를 받지 못합니다 import org.assertj.core.api.Assertions; 받지못하니 기능수행이 안되네요 bulid.gradle에 추가해야 할꺼같은데요
plugins { id 'org.springframework.boot' version '2.4.3' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' } group = 'hello' version = '0.0.1-SNAPSHOT' sourceCompatibility = '11' repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter' implementation 'junit:junit:4.12' implementation 'org.junit.jupiter:junit-jupiter:5.4.2' testImplementation ( 'org.springframework.boot:spring-boot-starter-test' ) { exclude group : 'org.junit.vintage' , module : 'junit-vintage-engine' } } test { useJUnitPlatform() } 어떤거를 추가해야 되지요??
- 1
- 4
- 1.5K