본문 바로가기
728x90

전체 글252

4. spring @Controller , @RequestMapping 기본 활용 예제 https://github.com/jeongwoohyunn/hellospring 예제는 hellospring 예제 활용 2번의 maven 프로젝트로 설정, 라이브러리와 webapp을 맞춰준뒤 진행하기 hellosrping/webapp/WEB-INF/spring-servlet 에서 베이스 패키지를 지정후에 local에서 주소 검색후 들어갈 수 있다. 1. 메서드 단독 매핑 12345678910@Controllerpublic class MainController { @ResponseBody //request mapping : 메서드에만 //메서드 단독 매핑 @RequestMapping({"/main/",""}) public String main() { return "MainController : main().. 2019. 3. 24.
java config, web.xml -> java config(web.xml을 java config에 넣다.) 예제 hellospring2 -> hellospring3 기본 메이븐 프로젝트 생성 및 라이브러리, pom 설정 완료 후 src/main/java에 com.douzone.hellospring.initializer 패키지 추가안에 HelloSpringWebApplicationInitializer 클래스 생성 HelloSpringWebApplicationInitializer 클래스는 web.xml의 역할을 대신하는 기능들을 가진다. web.xml 1234567891011121314151617181920212223242526272829303132333435363738 hellospring index.html index.htm index.jsp default.html default.htm default.jsp .. 2019. 3. 22.
3. spring 에서 주로 사용하는 @설명 2019. 3. 22.
2. Dnamic web project 생성후 maven project로 변경 및 설정 메이븐프로젝트만드는거 넣고 --- 1. 프로젝트 의존성 (라이브러리) 추가 - pom.xml 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 4.0.0 com.douzone hellospring 0.0.1-SNAPSHOT war 4.2.1.RELEASE org.springframework spring-context ${org.springframework-version} org.springframework spring-web ${org.springframework-version} org.springframework spring-webmvc ${org.springf.. 2019. 3. 22.