MESSL(maven + extjs + spring portlet mvc + spring web flow + liferay )整合架构 2
2013-02-23 14:56
621 查看
因为这是个基于spring的web应用,所以当然我们从web.xml看起:
在第11-16行,定义了Spring的配置文件,我当时设计时候,还是采用了多配置文件结构,所以在应用层,我只指定了这1个配置文件,这个配置文件定义了Spring应用的一些宏观的内容:
这个文件在/WEB-INF/config/applicatino-config.xml中:
<?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <!-- - Location of the XML file that defines the root application context - Applied by ContextLoaderListener. --> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/config/application-config.xml </param-value> </context-param> <!-- - Loads the root application context of this web app at startup. - The application context is then available via - WebApplicationContextUtils.getWebApplicationContext(servletContext). --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>ViewRendererServlet</servlet-name> <servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>ViewRendererServlet</servlet-name> <url-pattern>/WEB-INF/servlet/view</url-pattern> </servlet-mapping> </web-app>在第23-25行表示了我们进入spring框架,这个大家都知道。
在第11-16行,定义了Spring的配置文件,我当时设计时候,还是采用了多配置文件结构,所以在应用层,我只指定了这1个配置文件,这个配置文件定义了Spring应用的一些宏观的内容:
这个文件在/WEB-INF/config/applicatino-config.xml中:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" > <!-- Activates annotation-based bean configuration --> <context:annotation-config /> <!-- Scans for application @Components to deploy to spring container --> <context:component-scan base-package="xx.xx.xx.handlers" /> <context:component-scan base-package="xx.xx.xx.service.impl" /> <context:component-scan base-package="xx.xx.xx.portlet" /> </beans>我这里只开启了注解配置,并且启用了java包扫描,所以被我罗列的包中的所有Spring注解都会被扫描到,并且在Spring Application Context加载时自动实例化对应的被标注的 bean.
相关文章推荐
- MESSL(maven + extjs + spring portlet mvc + spring web flow + liferay )整合架构 6
- MESSL(maven + extjs + spring portlet mvc + spring web flow + liferay )整合架构 7
- MESSL(maven + extjs + spring portlet mvc + spring web flow + liferay )整合架构 8
- MESSL(maven + extjs + spring portlet mvc + spring web flow + liferay )整合架构 1
- MESSL(maven + extjs + spring portlet mvc + spring web flow + liferay )整合架构 4
- MESSL(maven + extjs + spring portlet mvc + spring web flow + liferay )整合架构 5
- Spring+SpringMVC+Mybatis整合系列(二)Eclipse新建Maven web项目
- Spring+SpringMVC+Mybatis整合系列(二)Eclipse新建Maven web项目
- (十)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven构建ant-utils工具项目
- (九)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven构建ant-framework核心代码Base封装
- (五)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven构建根项目
- (八)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven构建ant-framework核心代码annotation
- (四)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven代码结构
- (七)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven构建ant-framework框架的pom.xml文件配置
- (三)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven模块规划
- (六)springmvc+mybatis+dubbo+zookeeper分布式架构 整合 - maven构建config配置项目
- Maven+SpringMvc4+MyBatis+Jdk8+整合ssm架构
- Intellij IDEA采用Maven+Spring MVC+Hibernate的架构搭建一个java web项目
- Myeclipse创建Maven-web项目,并整合springmvc+mybatis
- Maven+Springmvc+mybatis+Dubbo+Zookeeper整合分布式架构