묻고 답해요
141만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
정적 컨텐츠 질문입니다.
http://localhost:8080/hello-static이 아닌http://localhost:8080/hello-static.html 으로 뒤에 .html을 붙이는 이유가 해당 파일은 맵핑이 되어있지 않아서 그런건가요?
-
미해결스프링 프레임워크는 내 손에 [스프1탄]
커리큘럼 질문
커리큘럼 소개하실 때 스프 2탄 mvc07부분에서리액트와의 연동 방법을 간략하게나마 보여주신다고 하셨는데스프2탄 커리큘럼에는 없는 것 같아서요! 스프2탄 mvc07 강의듣다보면 내용이 나오나요??
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
Test에서 AfterEach annotation 생성하기 전에 clearStore 메서드 추가하는 이유
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예)[질문 내용]여기에 질문 내용을 남겨주세요.안녕하세요.Test에서 아래 메서드를 추가하여 메모리에 있는 값을 초기화 시키는 것은 이해했습니다.@AfterEach public void afterEach() { repository.clearStore(); } 그런데, 아래 메서드를 추가하기 전에, 왜 MemoryMemberRepository class에서, 아래 메서드를 추가해야 하는지 모르겠습니다!public void clearStore() { store.clear(); }제가 Test 코드를 처음 작성하는데 이해가 되지 않아서 질문드립니다! 감사합니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
jpa부분에서 오류가 났어요...
일단 jpa로 진행하던중 오류가 났습니다..Member.javaMember.javapackage hwang.hwangspring.domain; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity //->JPA가 관리하는 ENTITY라는 의미가 됨 public class Member { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; //시스템이 정해줌 private String name; //고객이 회원가입할 때 적는 이름 public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } JpaMemberRepository.java import javax.persistence.EntityManager; import java.util.List; import java.util.Optional; public class JpaMemberRepository implements MemberRepository{ private final EntityManager em; public JpaMemberRepository(EntityManager em) { this.em = em; } @Override public Member save(Member member) { em.persist(member); return member; } @Override public Optional<Member> findById(Long id) { Member member = em.find(Member.class,id); return Optional.ofNullable(member); } @Override public Optional<Member> findByName(String name) { List<Member> result= em.createQuery("select m from Member m where m.name =:name",Member.class) .setParameter("name",name) .getResultList(); return result.stream().findAny(); } @Override public List<Member> findAll() { List<Member> result = em.createQuery("select m from Member m", Member.class).getResultList(); return result; //객체 자체를 return, } } Springconfig.javaimport org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import javax.persistence.Entity; import javax.persistence.EntityManager; import javax.sql.DataSource; @Configuration public class SpringConfig { private final EntityManager em; private final DataSource dataSource; @Autowired public SpringConfig(DataSource dataSource,EntityManager em){ this.dataSource=dataSource; this.em=em; } @Bean public MemberService memberService() { // 이 로직을 등록해서 스프링 빈에 등록을 해줌 return new MemberService((MemoryMemberRepository) memberRepository()); //MemberService()가 스트링빈에 등록됨 } @Bean public MemberRepository memberRepository(){ return new JpaMemberRepository(em); } } MemberIntegrataionTest를 실행할경우package hwang.hwangspring.service; import hwang.hwangspring.domain.Member; import hwang.hwangspring.repository.MemberRepository; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.transaction.annotation.Transactional; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @SpringBootTest @Transactional class MemberServiceIntegrationTest { @Autowired MemberService memberService; @Autowired MemberRepository memberRepository; @Test public void 회원가입() throws Exception { //Given Member member = new Member(); member.setName("hello"); //When Long saveId = memberService.join(member); //Then Member findMember = memberRepository.findById(saveId).get(); assertEquals(member.getName(), findMember.getName()); } @Test public void 중복_회원_예외() throws Exception { //Given Member member1 = new Member(); member1.setName("spring"); Member member2 = new Member(); member2.setName("spring"); //When memberService.join(member1); IllegalStateException e = assertThrows(IllegalStateException.class, () -> memberService.join(member2));//예외가 발생해야 한다. assertThat(e.getMessage()).isEqualTo("이미 존재하는 회원입니다."); } }아래와 같은 오류가 뜹니다 ㅠㅠ java.lang.IllegalStateException: Failed to load ApplicationContextat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:98)at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:248)at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:138)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$8(ClassBasedTestDescriptor.java:363)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:368)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$9(ClassBasedTestDescriptor.java:363)at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:362)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:283)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:282)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:272)at java.base/java.util.Optional.orElseGet(Optional.java:369)at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:271)at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:102)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:101)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:66)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90)at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:57)at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:232)at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:55)Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'memberController' defined in file [C:\Users\hyk46\hwang-spring\hwang-spring\out\production\classes\hwang\hwangspring\controller\MemberController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'memberService' defined in class path resource [hwang/hwangspring/SpringConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [hwang.hwangspring.service.MemberService]: Factory method 'memberService' threw exception; nested exception is java.lang.ClassCastException: class hwang.hwangspring.repository.JpaMemberRepository cannot be cast to class hwang.hwangspring.repository.MemoryMemberRepository (hwang.hwangspring.repository.JpaMemberRepository and hwang.hwangspring.repository.MemoryMemberRepository are in unnamed module of loader 'app')at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955)at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:920)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:136)at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:141)at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:90)... 71 moreCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'memberService' defined in class path resource [hwang/hwangspring/SpringConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [hwang.hwangspring.service.MemberService]: Factory method 'memberService' threw exception; nested exception is java.lang.ClassCastException: class hwang.hwangspring.repository.JpaMemberRepository cannot be cast to class hwang.hwangspring.repository.MemoryMemberRepository (hwang.hwangspring.repository.JpaMemberRepository and hwang.hwangspring.repository.MemoryMemberRepository are in unnamed module of loader 'app')at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1391)at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311)at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887)at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791)... 89 moreCaused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [hwang.hwangspring.service.MemberService]: Factory method 'memberService' threw exception; nested exception is java.lang.ClassCastException: class hwang.hwangspring.repository.JpaMemberRepository cannot be cast to class hwang.hwangspring.repository.MemoryMemberRepository (hwang.hwangspring.repository.JpaMemberRepository and hwang.hwangspring.repository.MemoryMemberRepository are in unnamed module of loader 'app')at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)... 103 moreCaused by: java.lang.ClassCastException: class hwang.hwangspring.repository.JpaMemberRepository cannot be cast to class hwang.hwangspring.repository.MemoryMemberRepository (hwang.hwangspring.repository.JpaMemberRepository and hwang.hwangspring.repository.MemoryMemberRepository are in unnamed module of loader 'app')at hwang.hwangspring.SpringConfig.memberService(SpringConfig.java:29)at hwang.hwangspring.SpringConfig$$EnhancerBySpringCGLIB$$f992599.CGLIB$memberService$0(<generated>)at hwang.hwangspring.SpringConfig$$EnhancerBySpringCGLIB$$f992599$$FastClassBySpringCGLIB$$aa36e038.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)at hwang.hwangspring.SpringConfig$$EnhancerBySpringCGLIB$$f992599.memberService(<generated>)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:566)at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)... 104 more
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
members 500 오류
제가 다 실험을 해봤는데 아래 문구때매 자꾸 서버가 500이 뜹니다. 강의 내용에 맞게 복붙해서 붙였는데 왜 자꾸 뜨는지 모르겠습니다...... 처음의 저 문제의 코드가 오류가 떠서 구글링 한결과 gradle에 아래를 추가했습니다. 오류가 안떠서 코드를 돌렸더니 서버가 500이 뜹니다... 도와주세요 ㅜㅜㅜimplementation group: 'javax.servlet', name: 'jstl', version: '1.2'gradle에 위와같은 문구를 추가했습니다. <%@ page contentType="text/html;charset=UTF-8" language="java" %>문제의 코드<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <a href="/index.html">메인</a> <table> <thead> <th>id</th> <th>username</th> <th>age</th> </thead> <tbody> <c:forEach var="item" items="${members}"> <tr> <td>item.id</td> <td>item.username</td> <td>item.age</td> </c:forEach> </tbody> </table> </body> </html> 전체 members.jsp 코드 package hello.servlet.web.servletmvc; import hello.servlet.domain.member.Member; import hello.servlet.domain.member.MemberRepository; import jakarta.servlet.RequestDispatcher; import jakarta.servlet.ServletException; import jakarta.servlet.annotation.WebServlet; import jakarta.servlet.http.HttpServlet; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @WebServlet(name="mvcMemberListServlet", urlPatterns = "/servlet-mvc/members") public class MvcMemberListServlet extends HttpServlet { MemberRepository memberRepository=MemberRepository.getInstance(); @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { List<Member> members = memberRepository.findAll(); request.setAttribute("members",members); String viewPath="/WEB-INF/views/members.jsp"; RequestDispatcher dispatcher = request.getRequestDispatcher(viewPath); dispatcher.forward(request,response); } } MvcMemberListServlet 코드
-
해결됨스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
@ModelAttribute 질문
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오) 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오) 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)예[질문 내용] //@PostMapping("/add") //requestParam 은 form 의 name 이름과 같아야함 public String saveV3(@ModelAttribute Item item,Model model){ // @ModelAttribute("item") 도생략가능하다. //Item (class명) ->item itemRepository.save(item); return "/basic/item"; }이 코드에서 @ModelAttribute 가 html 의 name 속성과 Item class 를 매칭시켜주고그래서 itemRepository에 저장 로직에서 사용된다는 거까지는 이해했습니다. 그러나 다시 '/basic/item' 화면으로 갈때 어떻게 저장시킨 item 이 화면에 렌더링되는건지 궁금합니다. Item newItem = itemRepository.save(item); model.addAttribute("item",newItem); 즉 , 이 과정이 어떻게 생략되서 작동되는지 원리가 궁금합니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
패키지 생성이 안됩니다.
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. 1:10 쯤 testcase 를 위한 package 생성을 하는데 제 파일은 패키지가 아닌건지 패키지를 생성할 수 있는 버튼이 뜨지 않습니다. 왜 이럴까요 ㅜㅜ
-
해결됨스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
HTTP API를 요구하는 직군에 대한 질문
1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 아니오[질문 내용]강의 마지막에 강사님께서 디자이너, 웹 퍼블리셔, 백엔드 개발자가 협업하여 서비스를 제작하게 된다는 설명을 해주셨습니다. 참고 부분에서 질문하고 싶은 부분이 있습니다. 마지막 문장에서 "백엔드 개발자는 HTML 뷰 템플릿을 직접 만지는 대신에, HTTP API를 통해 웹 클라이언트가 필요로 하는 데이터와 기능을 제공하면 된다."라고 적혀있었는데 HTTP API를 설계하는 것은 백엔드 개발자가 하는 것은 당연하지만, 어떤 HTTP API를 요구하는 지에 대해서는 프론트엔드 개발자가 하는 것인지 백엔드 개발자가 하는 것인지는 궁금합니다.설명을 덧붙이자면 디자이너분이 제공한 게시판 뷰가 있을 때 제공된 뷰에서 프론트 엔드 개발자가 화면을 만들기 위해서 백엔드 개발자에게 API를 요구하는 편이 일반적인지 혹은 백엔드 개발자가 API를 설계하여 일방적으로 프론트 개발자에게 제공하는게 일반적인지 궁금합니다. 감사합니다.
-
미해결[NarP Series] MVC 프레임워크는 내 손에 [나프1탄]
Mysql 연결 문제..
Could not connect to New MySQL. Error creating SQL Model Connection connection to New MySQL. (Error: Could not create connection to database server.) Could not create connection to database server. Error creating JDBC Connection connection to New MySQL. (Error: Could not create connection to database server.) Could not create connection to database server.계속 이 에러가 뜨면서 Mysql 연결이 안됩니다..구글링 해봤는데도 해결이 안되네요..
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
save.jsp 오류
[질문 템플릿]1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 예3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]여기에 질문 내용을 남겨주세요.new-form.jsp는 잘 접속이 되는데전송을 누르면 아래와 같이 오류가 발생합니다."C:\Program Files\Java\jdk-17.0.2\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.2\lib\idea_rt.jar=64020:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.2\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet\out\production\classes;C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet\out\production\resources;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\3.0.6\d0b6b836a6e3a223a92e6594c2d8c5f0a7cccec\spring-boot-starter-data-jpa-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\3.0.6\7c6597cae584c359d7e4ddea6e006176e0c15936\spring-boot-starter-web-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\2.1.1\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\jakarta.annotation-api-2.1.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\3.1.0\66901fa1c373c6aff65c13791cc11da72060a8d6\jakarta.persistence-api-3.1.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\p6spy-spring-boot-starter\1.9.0\b51740224ed4f0cdca7ba93fe9167e7b97064f41\p6spy-spring-boot-starter-1.9.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.querydsl\querydsl-jpa\5.0.0\2a653852848dee41b967d3520be3339f0f92f1ea\querydsl-jpa-5.0.0-jakarta.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-jasper\10.1.8\eefcfd4e175ca6a6db9fc1444bf452ebcf2956a0\tomcat-embed-jasper-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.servlet.jsp.jstl\jakarta.servlet.jsp.jstl-api\3.0.0\8ace30b09ce88dc6f19d4f59251cc83a23cc180a\jakarta.servlet.jsp.jstl-api-3.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.servlet\jakarta.servlet-api\6.0.0\abecc699286e65035ebba9844c03931357a6a963\jakarta.servlet-api-6.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.web\jakarta.servlet.jsp.jstl\3.0.1\78909a1354585b2a7a2d3b4e348fceff8b6d180\jakarta.servlet.jsp.jstl-3.0.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\3.0.5\84987fbd727eb0cf2f164dd07fe2bd697ddde8f1\spring-data-jpa-3.0.5.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-aop\3.0.6\bb39de062db9b7b7a277e6c026ed5ac45f544fc8\spring-boot-starter-aop-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\3.0.6\672661f4a90a9479170fba058a88892dac5ba69c\spring-boot-starter-jdbc-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.hibernate.orm\hibernate-core\6.1.7.Final\343f47b34c96fe9c44bf9b219a7b3c5d6d2fc90e\hibernate-core-6.1.7.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\6.0.8\53e6f4b4136b40cc0a7137fb05e38b45c2c286fe\spring-aspects-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\3.0.6\e0a1dd1653750a8e0a25b7b6be977231d7fa607e\spring-boot-starter-json-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\3.0.6\1029c155da41fa04820cf81fdbe5752260eead5\spring-boot-starter-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\3.0.6\feae12210905b6cb7ce8affce4f309665c4a805b\spring-boot-starter-tomcat-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\6.0.8\10b9481118ecf8ae9dc6f9fb47f95ed6da0e43e\spring-webmvc-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\6.0.8\b2d3643c5dd191b07c642adca0de40c303bb7505\spring-web-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.github.gavlyukovskiy\datasource-decorator-spring-boot-autoconfigure\1.9.0\831a15b04e176cd41c0539cda6194ac3e6b715ff\datasource-decorator-spring-boot-autoconfigure-1.9.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\p6spy\p6spy\3.9.0\7fedf78cc1e53a623a7b36d1f2705790836400aa\p6spy-3.9.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.querydsl\querydsl-core\5.0.0\7a469f78b7a89bae429f17766fb92687d0ab9e5b\querydsl-core-5.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\10.1.8\ec4b884806c65c80c86bb3db134f6f6f99e79ed8\tomcat-embed-core-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\10.1.8\6f3a4ae2ae37270eeb6e9bec4e7207facdc9e8fa\tomcat-embed-el-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.eclipse.jdt\ecj\3.33.0\4041d27ffea3c9351e3121f9bfe94dea4723d583\ecj-3.33.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.el\jakarta.el-api\5.0.0\2a22b304920f43d6427cdefb5ce5f6726e2a63a3\jakarta.el-api-5.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\6.0.8\4550c5e2bbb8cd07647b1b29b47c73cf4732de8c\spring-context-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\6.0.8\36c4cf00bab58bbcd60134a154e290185fa71bfa\spring-aop-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\6.0.8\97d41b8e4e9823e611cd49aa10730c4055720cb4\spring-orm-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\3.0.5\bd41ef8c15f83b2dcd699e358f6565d650280a0a\spring-data-commons-3.0.5.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\6.0.8\d12a11ae6a6a6cb76bcbbf2d496abd25adac4a98\spring-tx-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\6.0.8\86393eaf6ace0a84aeb42d3bebaa3c0a660deaed\spring-beans-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\6.0.8\70c3748212ba1a64978e4ed1a3e5050204f1fe15\spring-core-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\2.0.7\41eb7184ea9d556f23e18b5cb99cad1f8581fc00\slf4j-api-2.0.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.19\afbffb1210239fbba5cad73093c5b216d515838f\aspectjweaver-1.9.19.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\5.0.1\a74c7f0a37046846e88d54f7cb6ea6d565c65f9c\HikariCP-5.0.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\6.0.8\3f8e24e37d4ab6982c3979a6d19955023f93f145\spring-jdbc-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\2.0.1\51a520e3fae406abb84e2e1148e6746ce3f80a1a\jakarta.transaction-api-2.0.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.14.2\796518148a385b2728d44886cc0f8852eb8eeb53\jackson-datatype-jsr310-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.14.2\2b6c19b3d99dda02915515df879ab9e23fed3864\jackson-module-parameter-names-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.14.2\2f3c71211b6ea7a978eba33574d7135d536e07fb\jackson-datatype-jdk8-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.14.2\1e71fddbc80bb86f71a6345ac1e8ab8a00e7134\jackson-databind-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\3.0.6\8ccd83b2530c96595f92b4e07c1bb17560bfba8b\spring-boot-autoconfigure-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\3.0.6\95ac2c7aa28fcdef587b2c4f554016f8b9af624\spring-boot-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\3.0.6\fbbba25bd9870f9a85dd282133019750b79ad9eb\spring-boot-starter-logging-3.0.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\1.33\2cd0a87ff7df953f810c344bdf2fe3340b954c69\snakeyaml-1.33.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\10.1.8\7abb8ab966dd135924c8e69cb2f1db735dee5f23\tomcat-embed-websocket-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\6.0.8\2e4f2132fbf168e716a618442d6100b71a0e95f9\spring-expression-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.10.6\2026f75e43d1354530d70be6e88221a46d696ca8\micrometer-observation-1.10.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.mysema.commons\mysema-commons-lang\0.2.4\d09c8489d54251a6c22fbce804bdd4a070557317\mysema-commons-lang-0.2.4.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.tomcat\tomcat-annotations-api\10.1.8\1f26901ba8b329a65d063c15c81fd9c757b64feb\tomcat-annotations-api-10.1.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\6.0.8\72aa4dd5eaaede821d3f2ec856c2365c2042a326\spring-jcl-6.0.8.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.14.2\a7aae9525864930723e3453ab799521fdfd9d873\jackson-annotations-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.14.2\f804090e6399ce0cf78242db086017512dd71fcc\jackson-core-2.14.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.4.7\307944865579a6d490e6a4cbb5082dc8f36536ca\logback-classic-1.4.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.19.0\30f4812e43172ecca5041da2cb6b965cc4777c19\log4j-to-slf4j-2.19.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\2.0.7\a48f44aeaa8a5ddc347007298a28173ac1fbbd8b\jul-to-slf4j-2.0.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.10.6\ddbcbabad244c79537c918422ad3ba66e1a773b4\micrometer-commons-1.10.6.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.4.7\a2948dae4013d0e9486141b4d638d8951becb767\logback-core-1.4.7.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.19.0\ea1b37f38c327596b216542bc636cfdc0b8036fa\log4j-api-2.19.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.h2database\h2\2.1.214\d5c2005c9e3279201e12d4776c948578b16bf8b2\h2-2.1.214.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.5.0.Final\c19307cc11f28f5e2679347e633a3294d865334d\jboss-logging-3.5.0.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\6.0.6.Final\77a5f94b56d49508e0ee334751db5b78e5ccd50c\hibernate-commons-annotations-6.0.6.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.jboss\jandex\2.4.2.Final\1e1c385990b258ff1a24c801e84aebbacf70eb39\jandex-2.4.2.Final.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.5.1\3fe0bed568c62df5e89f4f174c101eab25345b6c\classmate-1.5.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.12.23\d470526e8c4566c04e9ae5d3ccb62d1a7aa58986\byte-buddy-1.12.23.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.2\e4e4e0c5b0d42054d00dc4023901572a60d368c7\jaxb-runtime-4.0.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.0\bbb399208d288b15ec101fa4fcfc4bd77cedc97a\jakarta.xml.bind-api-4.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.inject\jakarta.inject-api\2.0.0\46fc8560b6fd17b78396d88f39c1a730457671f0\jakarta.inject-api-2.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.10.1\10839f875928f59c622d675091d51a43ea0dc5f7\antlr4-runtime-4.10.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.2\8c29249f6c10f4ee08967783831580b0f5c5360\jaxb-core-4.0.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.1\88c774ab863a21fb2fc4219af95379fafe499a31\jakarta.activation-api-2.1.1.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\2.0.0\72369f4e2314d38de2dcbb277141ef0226f73151\angus-activation-2.0.0.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.2\24e167be69c29ebb7ee0a3b1f9b546f1dfd111fc\txw2-4.0.2.jar;C:\Users\user\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.1\9b3769c76235bc283b060da4fae2318c6d53f07e\istack-commons-runtime-4.1.1.jar hello.servlet.ServletApplication. ____ _/\\ / ___'_ __ (_)_ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/ ___)| |_)| | | | | || (_| | ) ) ) )' |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot :: (v3.0.6)2023-07-10T21:21:29.054+09:00 INFO 18224 --- [ main] hello.servlet.ServletApplication : Starting ServletApplication using Java 17.0.2 with PID 18224 (C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet\out\production\classes started by user in C:\Users\user\Desktop\여름방학\mvc1\servlet\servlet)2023-07-10T21:21:29.057+09:00 INFO 18224 --- [ main] hello.servlet.ServletApplication : No active profile set, falling back to 1 default profile: "default"2023-07-10T21:21:29.690+09:00 INFO 18224 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.2023-07-10T21:21:29.722+09:00 INFO 18224 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 21 ms. Found 0 JPA repository interfaces.2023-07-10T21:21:30.369+09:00 INFO 18224 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)2023-07-10T21:21:30.380+09:00 INFO 18224 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]2023-07-10T21:21:30.380+09:00 INFO 18224 --- [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.8]2023-07-10T21:21:30.613+09:00 INFO 18224 --- [ main] org.apache.jasper.servlet.TldScanner : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.2023-07-10T21:21:30.622+09:00 INFO 18224 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext2023-07-10T21:21:30.623+09:00 INFO 18224 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1515 ms2023-07-10T21:21:30.874+09:00 INFO 18224 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...2023-07-10T21:21:31.055+09:00 INFO 18224 --- [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:2a429fff-9c3c-4c40-906c-f7cb210a3f6a user=SA2023-07-10T21:21:31.057+09:00 INFO 18224 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.2023-07-10T21:21:31.109+09:00 INFO 18224 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]2023-07-10T21:21:31.171+09:00 INFO 18224 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 6.1.7.Final2023-07-10T21:21:31.473+09:00 INFO 18224 --- [ main] SQL dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect2023-07-10T21:21:31.720+09:00 INFO 18224 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]2023-07-10T21:21:31.734+09:00 INFO 18224 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'2023-07-10T21:21:31.767+09:00 WARN 18224 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning2023-07-10T21:21:31.964+09:00 INFO 18224 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: ServletContext resource [/index.html]2023-07-10T21:21:32.242+09:00 INFO 18224 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''2023-07-10T21:21:32.251+09:00 INFO 18224 --- [ main] hello.servlet.ServletApplication : Started ServletApplication in 3.565 seconds (process running for 3.966)2023-07-10T21:21:38.052+09:00 DEBUG 18224 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [0]2023-07-10T21:21:38.053+09:00 DEBUG 18224 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Received [POST /jsp/members/save.jsp HTTP/1.1Host: localhost:8080Connection: keep-aliveContent-Length: 19Cache-Control: max-age=0sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"sec-ch-ua-mobile: ?0sec-ch-ua-platform: "Windows"Upgrade-Insecure-Requests: 1Origin: http://localhost:8080Content-Type: application/x-www-form-urlencodedUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7Sec-Fetch-Site: same-originSec-Fetch-Mode: navigateSec-Fetch-User: ?1Sec-Fetch-Dest: documentReferer: http://localhost:8080/jsp/members/new-form.jspAccept-Encoding: gzip, deflate, brAccept-Language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7Cookie: JSESSIONID=3F23CBF50B03D193E74C819FC83D3488username=kim&age=20]2023-07-10T21:21:38.623+09:00 ERROR 18224 --- [nio-8080-exec-1] o.a.c.c.C.[.[localhost].[/].[jsp] : Servlet.service() for servlet [jsp] in context with path [] threw exception [Unable to compile class for JSP:An error occurred at line: [14] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.MemberRepository resolves to a packageAn error occurred at line: [15] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.Member resolves to a packageAn error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved to a type3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]Member cannot be resolved to a type7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));10: Member member = new Member(username, age);11: System.out.println("member = " + member);12: memberRepository.save(member);13: %>An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]Member cannot be resolved to a type7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));10: Member member = new Member(username, age);11: System.out.println("member = " + member);12: memberRepository.save(member);13: %>Stacktrace:] with root causeorg.apache.jasper.JasperException: Unable to compile class for JSP:An error occurred at line: [14] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.MemberRepository resolves to a packageAn error occurred at line: [15] in the generated java file: [C:\Users\user\AppData\Local\Temp\tomcat.8080.1494250641129783002\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.Member resolves to a packageAn error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved to a type3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]Member cannot be resolved to a type7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));10: Member member = new Member(username, age);11: System.out.println("member = " + member);12: memberRepository.save(member);13: %>An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]Member cannot be resolved to a type7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));10: Member member = new Member(username, age);11: System.out.println("member = " + member);12: memberRepository.save(member);13: %>Stacktrace:at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:102) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:213) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:513) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.compiler.Compiler.compile(Compiler.java:402) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.compiler.Compiler.compile(Compiler.java:372) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.compiler.Compiler.compile(Compiler.java:356) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:396) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:380) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:328) ~[tomcat-embed-jasper-10.1.8.jar:10.1.8]at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614) ~[jakarta.servlet-api-6.0.0.jar:6.0.0]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-10.1.8.jar:10.1.8]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-6.0.8.jar:6.0.8]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.8.jar:6.0.8]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-6.0.8.jar:6.0.8]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.8.jar:6.0.8]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-6.0.8.jar:6.0.8]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) ~[spring-web-6.0.8.jar:6.0.8]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:166) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:390) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:894) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1741) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-10.1.8.jar:10.1.8]at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]2023-07-10T21:21:38.633+09:00 INFO 18224 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'2023-07-10T21:21:38.634+09:00 INFO 18224 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'2023-07-10T21:21:38.635+09:00 INFO 18224 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms2023-07-10T21:21:38.743+09:00 DEBUG 18224 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@53f4c2e:org.apache.tomcat.util.net.NioChannel@1e491a57:java.nio.channels.SocketChannel[connected local=/[0:0:0:0:0:0:0:1]:8080 remote=/[0:0:0:0:0:0:0:1]:64023]], Status in: [OPEN_READ], State out: [CLOSED]
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
jar 랑 war
둘중에서 war 는 서버에 배포용이라고 하셧는데 포토폴리오 만들때 서버에 배포용으로 하려고 하면 war로 선택해서 프로젝트를 생성하야하나요? 아니면 jar 로 해도 상관없나요? 포토폴리오는 도메인과 서버를 구매해서 쓸 예정입니다.
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
@PostConstruct 애노테이션이 정확히 뭔가요?
@PostConstruct 이 애노테이션이 좀 생소해서요 뭔가 생성자에 관한것 같은데요 정확히 어떤 역할을 하는건가요?
-
해결됨스프링 부트 웹 개발 입문 - 따라하며 배우기
가격수정...404오류
404 오류 입니다...소스는 구글로 공유했습니다..
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
postman 500 오류
안녕하세요!! 강의 내용에 따라 진행했는데 자꾸 검사결과 다음과 같이 오류가 뜹니다... 원인이 궁금해서 질문올립니다. 감사합니다.
-
미해결스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
intellij 한글깨짐
1. 강의 내용과 관련된 질문인가요? 예2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? 아니오3. 질문 잘하기 메뉴얼을 읽어보셨나요? 예[질문 내용]인텔리제이 한글꺠짐 해결하려고 아래의 블로그 보고 하라는대로 따라했는데 해결이 안됩니다 ..https://knoow.tistory.com/195인텔리제이 설치 경로의 bin폴더로 가서 idea64.exe.vmotions 파일을 처음에 인텔리제이로 열어서 수정했다가 저장이 안되는 것 같길래 메모장으로 열어서다음과 같이 코드 넣고 저장 눌렀습니다 근데 아이콘도 메모장으로 바뀌고 파일명도 idea64.exe 로 변해서(근데 파일 속성 보면 vmotions 파일은 맞았어요) 다시 idea64.exe.vmotions으로 파일 이름을 변경했어요인텔리제이로 hello spring 프로젝트 열어서 help> edit custom VM options -Dfile.encoding=UTF-8 추가했구요build.gradle 가서 아래처럼 코드도 추가했습니다file > settings > File encodings모든 설정을 다 UTF - 8 로 다 바꿨구요 EUC-KR로도 바꿔서 실행도 해봤습니다 근데도 자꾸 꺠져서 출력됩니다 어떻게 해야하나요 .. 흑흑
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
SpringMemberControllerV1. 404에러
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요. 안녕하세요.서블릿으로 구현할때까지는 잘 실행 되었는데..스프링mvc 부터 자꾸 404가 뜹니다.브라우저에서 입력하면 매핑된 process메서드는 실행을 하는데 modelAndView에서 에러가 나는거 같습니다.맨 밑 사진은 디버깅해봤는데..class has no fields랍니다..modelAndView를 따로 처리를 해줘야 되는건가요?아니면 다른걸 잘못하고 있는건가요..?
-
해결됨스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
섹션2 HTTP요청 데이터 - POST HTML Form 강의 질문
안녕하세요 섹션2 HTTP요청 데이터 -POST HTML Form 강의에서hello-form에서 username과 age 를 입력하고 제출 버튼을 누르면 f12에서 이렇게 request-param을 확인하셨는데 저는 제출을 눌러도 이게 뜨지 않습니다.그러나 콘솔에서는 getParameter()로 값을 정상적으로 출력을 하는데 f12에서는 왜 확인이 안될까요?
-
미해결스프링 MVC 2편 - 백엔드 웹 개발 활용 기술
Error parsing HTTP request header 문제
안녕하세요.MVC 2편 파일 업로드 강의를 수강하는 중 발생하는 문제 질문드립니다.스프링 버전 문제인가 싶어서, 강사님 프로젝트를 그대로 다운로드해서 빌드했는데도 (2.5.1 버전), 모든 페이지에서 저렇게 에러가 발생합니다.(index페이지만가도) 어떤 부분을 수정해야할까요 ? 2023-07-08 12:06:39.541 INFO 8668 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'2023-07-08 12:06:39.542 INFO 8668 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'2023-07-08 12:06:39.543 INFO 8668 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 1 ms2023-07-08 12:06:39.636 DEBUG 8668 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [728]2023-07-08 12:06:39.636 DEBUG 8668 --- [nio-8080-exec-1] o.a.coyote.http11.Http11InputBuffer : Received []2023-07-08 12:06:39.637 DEBUG 8668 --- [nio-8080-exec-1] o.apache.coyote.http11.Http11Processor : Socket: [org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper@240fb734:org.apache.tomcat.util.net.NioChannel@3c42f742:java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1:8080 remote=/0:0:0:0:0:0:0:1:53200]], Status in: [OPEN_READ], State out: [OPEN]2023-07-08 12:06:43.954 DEBUG 8668 --- [nio-8080-exec-2] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [728]2023-07-08 12:06:43.955 DEBUG 8668 --- [nio-8080-exec-3] o.a.coyote.http11.Http11InputBuffer : Before fill(): parsingHeader: [true], parsingRequestLine: [true], parsingRequestLinePhase: [0], parsingRequestLineStart: [0], byteBuffer.position(): [0], byteBuffer.limit(): [0], end: [0]2023-07-08 12:06:43.970 DEBUG 8668 --- [nio-8080-exec-2] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request headerjava.io.EOFException: null at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1345) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1255) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:799) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:359) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:261) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.46.jar:9.0.46] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]2023-07-08 12:06:43.970 DEBUG 8668 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor : Error parsing HTTP request header
-
미해결스프링 MVC 1편 - 백엔드 웹 개발 핵심 기술
An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]
save.jsp 에서 화면에서 jsp가 제대로 등록되지 않은 같습니다. <에러코드> An error occurred at line: [14] in the generated java file: [C:\Users\ParkWonkyoung\AppData\Local\Temp\tomcat.8080.2915155530144798779\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.MemberRepository resolves to a packageAn error occurred at line: [15] in the generated java file: [C:\Users\ParkWonkyoung\AppData\Local\Temp\tomcat.8080.2915155530144798779\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.Member resolves to a packageAn error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved to a type3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]Member cannot be resolved to a type7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));10: Member member = new Member(username, age);11: System.out.println("member = " + member);12: memberRepository.save(member);13: %>An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]Member cannot be resolved to a type7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));10: Member member = new Member(username, age);11: System.out.println("member = " + member);12: memberRepository.save(member);13: %>Stacktrace:] with root causeorg.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [14] in the generated java file: [C:\Users\ParkWonkyoung\AppData\Local\Temp\tomcat.8080.2915155530144798779\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.MemberRepository resolves to a packageAn error occurred at line: [15] in the generated java file: [C:\Users\ParkWonkyoung\AppData\Local\Temp\tomcat.8080.2915155530144798779\work\Tomcat\localhost\ROOT\org\apache\jsp\jsp\members\save_jsp.java]Only a type can be imported. hello.servlet.domain.member.Member resolves to a packageAn error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved to a type3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [6] in the jsp file: [/jsp/members/save.jsp]MemberRepository cannot be resolved3: <%@ page contentType="text/html;charset=UTF-8" language="java" %>4: <%5: // request, response 사용 가능6: MemberRepository memberRepository = MemberRepository.getInstance();7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));An error occurred at line: [10] in the jsp file: [/jsp/members/save.jsp]Member cannot be resolved to a type7: System.out.println("save.jsp");8: String username = request.getParameter("username");9: int age = Integer.parseInt(request.getParameter("age"));10: Member member = new Member(username, age);11: System.out.println("member = " + member);12: memberRepository.save(member);13: %>
-
해결됨스프링 부트 웹 개발 입문 - 따라하며 배우기
메뉴명이 안나와요~
소스는 구글에 올리겠습니다..