Skip to content

Instantly share code, notes, and snippets.

@bytestree
Last active May 6, 2016 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bytestree/f9021a105ccc5c4fa6f1ec2a1c42f977 to your computer and use it in GitHub Desktop.
Save bytestree/f9021a105ccc5c4fa6f1ec2a1c42f977 to your computer and use it in GitHub Desktop.
Spring context file to configure property placeholder, resource bundles, view resolver and import other configutation files.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
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-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd">
<context:annotation-config />
<context:component-scan base-package="com.bytestree.*" />
<context:property-placeholder location="classpath:application.properties"/>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>classpath:messages</value>
</list>
</property>
</bean>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<import resource="classpath*:/spring-security.xml" />
<import resource="classpath*:/dao-context.xml" />
</beans>
@bytestree
Copy link
Author

Refer Spring Security 4 with Hibernate for complete example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment