본문 바로가기

분류 전체보기273

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 원인 : 이전 작업 프로젝트에서 수정되지 않았을 때 가끔 발생함.해결 : 1) Tomcat 서버 우클릭 - Clean Tomcat Work Directory 2) Tomcat 서버 우클릭 - Clean 3) Tomcat 서버 재시작 하니까 해결 ~~~ 2018. 5. 4.
@RequestParam 과 @ModelAttribute @RequestParam단일 HTTP요청 파라미터값을 메소드 파라미터에 넣어주는 Annotation "no" 라는 네임으로 요청들어온 파라미터값을 int 타입의 no 변수에 담는다.1234@RequestMapping("/testView.do")public String testView( @RequestParam("no") int no ){ Logic...}Colored by Color Scriptercs 여기서 중요하게 봐야할 것은 Prarmeter 값이 존재하지 않을 경우 404에러가 뜬다는 것 !!!그럴 땐 아래와 같이 유연하게 코딩하자.1) required=false : 별도로 널체크를 하지 않아도 됨1234@RequestMapping("/testView.do")public String testVie.. 2018. 5. 4.
Cannot instantiate the type 클래스 Cannot instantiate the type 클래스 원인 : 인터페이스로 선언한 클래스를 new 키워드로 생성하려함 (기초기초ㅠㅠ 당연히 에러가 나는 것을..)해결 : new 키워드로 생성하려던건 다른 클래스여서 수정함!!! 2018. 5. 3.
MongoDB 사용방법 1. 설치 https://www.hugeserver.com/kb/install-mongodb-centos-6-7/Install MongoDB 3.4 on CentOS 6 and 7Introduction MongoDB is a scalable, high-performance, open source NoSQL database. The database is document-oriented so it manage...www.hugeserver.com Install MongoDBFor installing the latest stable version of MongoDB you should add MongoDB repository first.Adding MongoDB RepositoryMove to the foll.. 2018. 5. 3.
Servlet파일 annotation으로 web.xml에 매핑하지말자 Servlet 파일을 계속 만들때마다 web.xml에 매핑을 해줬어야했는데,Servlet SPEC 3.0 이상부터 지원하는 annotation를 쓰게되면 매핑을 안해줘도 된다 ... 1234@WebServlet("/LoginBean")public class LoginBean extends HttpServlet { ...}Colored by Color Scriptercs 2018. 5. 3.
Spring MVC 핵심 Component DispatcherServletSpring MVC Framework의 Front Controller, 웹요청과 응답의 LifeCycle을 주관한다.Spring MVC Framework의 Front Controller(단일인입점) HandlerMapping웹요청시 해당 URL을 어떤 Controller가 처리할지 결정한다.Client의 Request URI와 Controller을 연결시켜준다. ControllerBussiness Logic을 수행하고 결과 데이터를 ModelAndView에 반영한다.Client의 요구사항을 처리한다. ModelAndViewController가 수행결과를 반영하는 Model 데이터 객체와 이동할 페이지 정보(또는 View객체)로 이루어져 있다.Model(data)와 View(.. 2018. 5. 3.