Skip to content

Instantly share code, notes, and snippets.

@martinlau
Created November 30, 2012 00:28
Show Gist options
  • Save martinlau/4172888 to your computer and use it in GitHub Desktop.
Save martinlau/4172888 to your computer and use it in GitHub Desktop.
Spring web.xml and applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="transactionManager" class="com.liferay.util.spring.transaction.TransactionManagerClp" init-method="init"/>
<bean id="portal" class="com.liferay.portal.util.PortalUtil" factory-method="getPortal" />
<bean id="userLocalService" class="com.liferay.portal.service.UserLocalServiceUtil" factory-method="getService" />
<bean id="fakeService" class="au.com.permeance.service.impl.FakeServiceImpl">
<constructor-arg index="0" name="portal" ref="portal" />
<constructor-arg index="1" name="userLocalService" ref="userLocalService" />
</bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment