Biblioteca Java - Blame information for rev 9
Subversion Repositories:
(root)/Spring/SpringWebMVC/InventoryHibernate/src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml
Rev | Author | Line No. | Line |
---|---|---|---|
9 | mihai | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <beans:beans xmlns="http://www.springframework.org/schema/mvc" | ||
3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans" | ||
4 | xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" | ||
5 | xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd | ||
6 | http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd | ||
7 | http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd | ||
8 | http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd "> | ||
9 | |||
10 | <!-- DispatcherServlet Context: defines this servlet's request-processing | ||
11 | infrastructure --> | ||
12 | |||
13 | <!-- Enables the Spring MVC @Controller programming model --> | ||
14 | <annotation-driven /> | ||
15 | |||
16 | <!-- Handles HTTP GET requests for /resources/** by efficiently serving | ||
17 | up static resources in the ${webappRoot}/resources directory --> | ||
18 | <resources mapping="/resources/**" location="/resources/" /> | ||
19 | |||
20 | <!-- Resolves views selected for rendering by @Controllers to .jsp resources | ||
21 | in the /WEB-INF/views directory --> | ||
22 | <beans:bean | ||
23 | class="org.springframework.web.servlet.view.InternalResourceViewResolver"> | ||
24 | <beans:property name="prefix" value="/WEB-INF/views/" /> | ||
25 | <beans:property name="suffix" value=".jsp" /> | ||
26 | </beans:bean> | ||
27 | |||
28 | <beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" | ||
29 | destroy-method="close"> | ||
30 | <beans:property name="driverClassName" value="com.mysql.jdbc.Driver" /> | ||
31 | <beans:property name="url" | ||
32 | value="jdbc:mysql://localhost:3306/registru_inventar_db" /> | ||
33 | <beans:property name="username" value="root" /> | ||
34 | <beans:property name="password" value="root" /> | ||
35 | </beans:bean> | ||
36 | |||
37 | <!-- Hibernate 4 SessionFactory Bean definition --> | ||
38 | <beans:bean id="hibernate4AnnotatedSessionFactory" | ||
39 | class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> | ||
40 | <beans:property name="dataSource" ref="dataSource" /> | ||
41 | <beans:property name="annotatedClasses"> | ||
42 | <beans:list> | ||
43 | <beans:value>com.linkscreens.inventory.entity.InventoryItem</beans:value> | ||
44 | </beans:list> | ||
45 | </beans:property> | ||
46 | <beans:property name="hibernateProperties"> | ||
47 | <beans:props> | ||
48 | <beans:prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect | ||
49 | </beans:prop> | ||
50 | <beans:prop key="hibernate.show_sql">true</beans:prop> | ||
51 | </beans:props> | ||
52 | </beans:property> | ||
53 | </beans:bean> | ||
54 | |||
55 | <beans:bean id="inventoryDAO" class="com.linkscreens.inventory.dao.InventoryDaoImpl"> | ||
56 | <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory" /> | ||
57 | </beans:bean> | ||
58 | |||
59 | <beans:bean id="inventoryService" class="com.linkscreens.inventory.service.InventoryServiceImpl"> | ||
60 | <beans:property name="inventoryDao" ref="inventoryDAO"></beans:property> | ||
61 | </beans:bean> | ||
62 | |||
63 | <context:component-scan base-package="com.linkscreens.inventory" /> | ||
64 | |||
65 | <tx:annotation-driven transaction-manager="transactionManager"/> | ||
66 | |||
67 | <beans:bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> | ||
68 | <beans:property name="sessionFactory" ref="hibernate4AnnotatedSessionFactory" /> | ||
69 | </beans:bean> | ||
70 | |||
71 | |||
72 | <beans:bean id="itemValidator" class="com.linkscreens.inventory.validator.ItemValidator" /> | ||
73 | |||
74 | <beans:bean id="messageSource" | ||
75 | class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> | ||
76 | <beans:property name="basename" value="classpath:message" /> | ||
77 | <beans:property name="defaultEncoding" value="UTF-8" /> | ||
78 | </beans:bean> | ||
79 | |||
80 | </beans:beans> |