web.xml에 넣어준다.
<filter>
<filter-name>HibernateSession</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>HibernateSession</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Resource 폴더에 applicationContext-hibernate.xml 만든다.
그리고 web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml
classpath:org/hibernate/**/applicationContext*.xml</param-value>
</context-param>
다음과 같이 읽을수 있도록 연결
이제 Hibernate에서 매핑작업을 진행하면 된다.~! 그전에 Mysql에서 테이블을 임의로 만든다.
'Development > Web & Server' 카테고리의 다른 글
[Spring Framework] Spring + Hibernate으로 JSON 출력하기 (4) - Dao, Service 만들기 (0) | 2013.10.22 |
---|---|
[Spring Framework] Spring + Hibernate으로 JSON 출력하기 (3) - Mapping 하기 (0) | 2013.10.22 |
[Vert.x] 간단 예제 (소켓 연결후 메시지 전달) (0) | 2013.10.22 |
Vert.x 설치하기 (0) | 2013.10.21 |
Vert.x 에대해서.. (0) | 2013.10.21 |