Archive

Posts Tagged ‘application-context’

Spring Servlet Mapping XML All Cut point for my Spring Hiberntate Solution

June 15th, 2011
Comments Off

Content about : Spring Servlet Mapping XML
Advertisements


This XML is Configuration for all Cut point from View , Controller and Model in this XML is Contain
Bean mapping factory for Model Class , Interceptor  and Controller

Example Servlet XML Mapping for Spring Framework
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE beans PUBLIC “-//SPRING//DTD BEAN//EN” “http://www.springframework.org/dtd/spring-beans.dtd”>

<beans>
<bean id=”configurer” class=”org.springframework.beans.factory.config.PropertyPlaceholderConfigurer”>
<property name=”location” value=”file:/EnterprisePT/conf.properties”/>
</bean>

<bean id=”viewResolver” class=”org.springframework.web.servlet.view.InternalResourceViewResolver”>
<property name=”viewClass” value=”org.springframework.web.servlet.view.JstlView” />
<property name=”prefix” value=”/jsp/” />
<property name=”suffix” value=”.jsp” />
<property name=”contentType” value=”text/html; charset=UTF-8″ />
</bean>
<bean id=”urlMapping” class=”org.springframework.web.servlet.handler.SimpleUrlHandlerMapping”>
<property name=”interceptors”>
<list>
<ref local=”exampleInterceptor”/>
</list>
</property>
<property name=”mappings”>
<props>
<prop key=”/example_insert.html”>exampleController</prop>
<prop key=”/example_load.html”>exampleController</prop>
<prop key=”/example_delete.html”>exampleController</prop>
<prop key=”/example_ws.html”>exampleController</prop>
<prop key=”/example_sap.html”>exampleController</prop>
</props>
</property>
</bean>

<!– ========================= CONTROLLER DEFINITIONS ========================= –>
<bean id=”exampleController” class=”com.en.controller.ExampleController”>
<property name=”methodNameResolver” ref=”exampleControllerResolver”/>
<property name=”model” ref=”exampleModel”/>
<property name=”defaultScreen” value=”example”/>
</bean>
<bean id=”exampleControllerResolver” class=”org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver”>
<property name=”mappings”>
<props>
<prop key=”/example_insert.html”>insertMethod</prop>
<prop key=”/example_load.html”>loadMethod</prop>
<prop key=”/example_delete.html”>deleteMethod</prop>
<prop key=”/example_ws.html”>callWS</prop>
<prop key=”/example_sap.html”>callSAP</prop>
</props>
</property>
</bean>
<bean id=”exampleModel” class=”com.en.model.ExampleModel”>
<property name=”hibernateTemplate” ref=”hibernateTemplate”/>
<property name=”wsClient” ref=”exampleWSClient”/>
<property name=”sap” ref=”exampleSAP”/>
</bean>

<bean id=”exampleInterceptor” class=”com.en.interceptor.ExampleInterceptor” />
<bean id=”exampleWSClient” class=”com.en.ws.client.ExampleWSClient”>
<property name=”endpoint” value=”http://127.0.0.1:8080/EnterPrisePT/ws/example”/>
</bean>
<bean id=”exampleSAP” class=”com.en.sap.ExampleSAP” />

</beans>

Development , ,