<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>mongodb-demo</groupId> <artifactId>mongodb-demo</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>mongodb-demo</name> <properties> <project.build.finalName>mongodb-demo</project.build.finalName> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <org.apache.struts.version>2.3.15.1</org.apache.struts.version> <org.springframework.version>3.2.8.RELEASE</org.springframework.version> <deploy.home>${env.TOMCAT_HOME}/webapps/${project.build.finalName}</deploy.home> </properties> <dependencyManagement> <dependencies> <!-- Struts Framework Configuration --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>${org.apache.struts.version}</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-convention-plugin</artifactId> <version>${org.apache.struts.version}</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>${org.apache.struts.version}</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </exclusion> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-jasperreports-plugin</artifactId> <version>${org.apache.struts.version}</version> </dependency> <!-- Spring Framework Configuration --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-commons</artifactId> <version>1.7.1.RELEASE</version> </dependency> <!-- MongoDB --> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb</artifactId> <version>1.4.2.RELEASE</version> </dependency> <dependency> <groupId>org.mongodb</groupId> <artifactId>mongo-java-driver</artifactId> <version>2.11.4</version> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- Struts Framework Configuration --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-convention-plugin</artifactId> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-jasperreports-plugin</artifactId> </dependency> <!-- Spring Framework Configuration --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-commons</artifactId> </dependency> <!-- MongoDB --> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-mongodb</artifactId> </dependency> <dependency> <groupId>org.mongodb</groupId> <artifactId>mongo-java-driver</artifactId> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.7-beta2</version> </dependency> <!-- db and db driver --> <!-- Report Tools --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.3</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.6.3</version> </dependency> <dependency> <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <version>1.8.4</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.6</version> </dependency> <!-- json 插件 --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-json-plugin</artifactId> <version>2.2.3</version> </dependency> <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy</artifactId> <version>1.8.3</version> </dependency> <dependency> <groupId>com.lowagie</groupId> <artifactId>itextasian</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>commons-digester</groupId> <artifactId>commons-digester</artifactId> <version>1.7</version> </dependency> <dependency> <groupId>itext</groupId> <artifactId>itext</artifactId> <version>2.1.7</version> </dependency> <dependency> <groupId>com</groupId> <artifactId>csvjdbc</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.apache.tika</groupId> <artifactId>tika-core</artifactId> <version>1.0</version> </dependency> <!-- <dependency> <groupId>jofc2</groupId> <artifactId>jofc2</artifactId> <version>2.2</version> </dependency> --> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <type>jar</type> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <type>jar</type> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-all</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>jsr250-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.3</version> <classifier>jdk15</classifier> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.1.26</version> </dependency> <dependency> <groupId>javax.jms</groupId> <artifactId>jms</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-all</artifactId> <version>5.7.0</version> </dependency> <dependency> <!-- jsoup HTML parser library @ http://jsoup.org/ --> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.7.3</version> </dependency> <!-- ACCA Java Application Framework --> <!-- <dependency> --> <!-- <groupId>cn.com.acca</groupId> --> <!-- <artifactId>ajaf</artifactId> --> <!-- </dependency> --> </dependencies> <build> <finalName>${project.build.finalName}</finalName> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> <resource> <directory>src/main/webapp</directory> <filtering>false</filtering> <excludes> <exclude>**</exclude> </excludes> </resource> </resources> <testResources> <testResource> <directory>src/test/resources</directory> <filtering>true</filtering> </testResource> </testResources> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clean-plugin</artifactId> <version>2.5</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.5.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.9.1</version> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <artifactId>maven-clean-plugin</artifactId> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <argLine>-Xmx=512m -XX:MaxPermSize=256m</argLine> <forkMode>once</forkMode> <argLine>-enableassertions</argLine> <testFailureIgnore>true</testFailureIgnore> <parallel>methods</parallel> <threadCount>1</threadCount> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <warSourceDirectory>${project.basedir}/src/main/webapp </warSourceDirectory> </configuration> </plugin> <plugin> <artifactId>maven-site-plugin</artifactId> </plugin> <plugin> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> <configLocation>coding_standards_checkstyle.xml</configLocation> </configuration> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.5.1</version> <reportSets> <reportSet> <reports> <report>index</report> <report>dependency-management</report> <report>dependencies</report> <report>plugin-management</report> <report>plugins</report> <report>summary</report> </reports> <configuration> <dependencyDetailsEnabled>false</dependencyDetailsEnabled> <dependencyLocationsEnabled>false</dependencyLocationsEnabled> </configuration> </reportSet> </reportSets> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>2.3</version> <configuration> <aggregate>true</aggregate> </configuration> <reportSets> <reportSet> <id>default</id> <reports> <report>jxr</report> </reports> </reportSet> </reportSets> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.9.1</version> <configuration> <configLocation>coding_standards_checkstyle.xml</configLocation> </configuration> <reportSets> <reportSet> <reports> <report>checkstyle</report> </reports> </reportSet> </reportSets> </plugin> </plugins> </reporting> <profiles> <profile> <id>dev</id> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>hot-deploy</id> <phase>process-resources</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <copy todir="${deploy.home}" failonerror="false"> <fileset dir="${project.basedir}/src/main/webapp" /> </copy> <copy todir="${deploy.home}/WEB-INF/classes" failonerror="false"> <fileset dir="${project.basedir}/target/classes" /> </copy> </target> </configuration> </execution> <execution> <id>dev-deploy</id> <phase>install</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <delete dir="${deploy.home}" /> <mkdir dir="${deploy.home}" /> <copy todir="${deploy.home}" failonerror="false"> <fileset dir="${project.basedir}/target/${project.build.finalName}" /> </copy> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project>
mongo.host=127.0.0.1 mongo.port=27017 mongo.connectionsPerHost=8 mongo.connectTimeout=1000 mongo.maxWaitTime=1500 mongo.autoConnectRetry=true mongo.socketTimeout=2000 mongo.threadsAllowedToBlockForConnectionMultiplier=4 mongo.socketKeepAlive=true mongo.fsync=true mongo.slaveOk=true
<?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:mongo="http://www.springframework.org/schema/data/mongo" xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <context:annotation-config /> <context:component-scan base-package="com.mongo.*" /> <context:property-placeholder location="classpath:/mongo.properties" /> <mongo:mongo host="${mongo.host}" port="${mongo.port}"> <mongo:options connections-per-host="${mongo.connectionsPerHost}" threads-allowed-to-block-for-connection-multiplier="${mongo.threadsAllowedToBlockForConnectionMultiplier}" connect-timeout="${mongo.connectTimeout}" max-wait-time="${mongo.maxWaitTime}" auto-connect-retry="${mongo.autoConnectRetry}" socket-keep-alive="${mongo.socketKeepAlive}" socket-timeout="${mongo.socketTimeout}" slave-ok="${mongo.slaveOk}" write-number="1" write-timeout="0" write-fsync="true" /> </mongo:mongo> <!-- mongo的工厂,通过它来取得mongo实例,dbname为mongodb的数据库名,没有的话会自动创建 --> <mongo:db-factory dbname="test01" mongo-ref="mongo" /> <!-- mongodb的主要操作对象,所有对mongodb的增删改查的操作都是通过它完成 --> <bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"> <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" /> </bean> <!-- 映射转换器,扫描back-package目录下的文件,根据注释,把它们作为mongodb的一个collection的映射 --> <mongo:mapping-converter base-package="com.mongo.entity.*.entity" /> <!-- mongodb bean的仓库目录,会自动扫描扩展了MongoRepository接口的接口进行注入 --> <mongo:repositories base-package="com.mongo.dao.*.dao" /> </beans>
时间有限,刚刚把项目框架打起来,后续会继续做页面的相关实现
相关推荐
Struts2+Spring+Maven+MongoDB是一个常见的企业级Web应用开发框架组合,这个项目骨架为开发者提供了一个快速启动新项目的基础结构。下面将详细解释这些技术组件以及它们在项目中的作用。 **Struts2** 是一个基于MVC...
Struts2、Spring、Maven和MongoDB是四个在Java开发中非常重要的技术组件,它们分别扮演着不同的角色,共同构建了一个高效、可扩展的Web应用程序框架。 首先,Struts2是一个基于MVC(Model-View-Controller)设计...
**基于Struts2+Spring+Maven+MongoDB项目骨架详解** 该项目骨架是为开发者提供了一个快速搭建基于Java EE的Web应用的基础结构,利用Struts2作为MVC框架,Spring进行依赖注入和事务管理,Maven作为构建工具,以及...
* 大润发网上商城项目: SpringMVC+Spring+Mybatis + dubbo+zookeeper+Solr + Maven + Git+ Nginx + Tomcat7.0 + MySql + MongoDB+shiro 等技术栈的应用。 * 银豆网贷系统项目: Eclipse+MySql+ Tomcat+ Dubbo+...
5. **JSP与Action间的传值**:这通常指的是在Web应用中,Action(如Struts2或Spring MVC的Controller)接收来自JSP页面的用户输入,进行业务处理后,将结果返回到JSP进行展示。常见的传值方式有请求参数、模型驱动、...
struts2框架--->linux--->SSM项目综合小练习--->SpringBoot--->SpringCloud--->Redis--->MongoDB--->FreeMaker--->Nginx--->RabbitMQ--->Dubbo--->Zookeeper--->分布式项目实战...
- 如果整合Struts2,需要`spring-struts.jar`。 - 整合MyBatis时,需要`mybatis-spring.jar`。 - 整合Hibernate,需包含`hibernate-entitymanager.jar`和`hibernate-core.jar`,以及`spring-orm.jar`。 - 整合...
* 大润发网上商城(飞牛网):开发环境为 Windows+Eclipse+Mysql+JDK1.7+Tomcat+ftp,软件架构为 SpringMVC+Spring+Mybatis+dubbo+zookeeper+Solr+Maven+Git+Nginx+Tomcat7.0+Mysql+Mongodb+shiro。 * 银豆网贷系统...
后端框架:Spring、Spring Boot, Spring MVC, JavaServer Faces (JSF), Struts 等。 数据存储:MySQL, Oracle, MongoDB, Cassandra, Hibernate 等。 缓存技术:Redis, memcached 等。消息队列:Apache Kafka, ...
下面将分别介绍`commons`、`struts`、`spring`以及`mongodb`相关的知识点。 1. **Apache Commons**: Apache Commons 是一系列独立的、实用的Java组件集合,它包含了众多子项目,如: - Commons Lang:提供了一些...
后端框架:Spring Boot, Spring MVC, JavaServer Faces (JSF), Struts 等。 数据存储:MySQL, Oracle, MongoDB, Cassandra, Hibernate 等。 缓存技术:Redis, memcached 等。消息队列:Apache Kafka, RabbitMQ 等。 ...
struts2框架--->linux--->SSM项目综合小练习--->SpringBoot--->SpringCloud--->Redis--->MongoDB--->FreeMaker--->Nginx--->RabbitMQ--->Dubbo--->Zookeeper-
- **src/main/resources**:存储配置文件,如Hibernate的实体映射文件(hbm.xml)、Spring的配置文件(spring-context.xml)和Struts2的配置(struts.xml)。 - **Web-INF**:包含web.xml,定义了Web应用的部署描述符。 - ...
后端框架:Spring Boot, Spring MVC, JavaServer Faces (JSF), Struts 等。 数据存储:MySQL, Oracle, MongoDB, Cassandra, Hibernate 等。 缓存技术:Redis, memcached 等。消息队列:Apache Kafka, RabbitMQ 等。 ...
SSM(Spring、Struts、Mybatis)与MEVN(MongoDB、Express、Vue.js、Node.js)是两种常见的Web开发框架。本文将详细介绍如何在IntelliJ IDEA(简称Idea)中搭建SSM项目,并解决新手可能遇到的问题。 首先,我们需要...
后端框架:Spring Boot, Spring MVC, JavaServer Faces (JSF), Struts 等。 数据存储:MySQL, Oracle, MongoDB, Cassandra, Hibernate 等。 缓存技术:Redis, memcached 等。消息队列:Apache Kafka, RabbitMQ 等。 ...
2. **框架技能**:熟练掌握SpringMVC、Spring、MyBatis、Struts2、Hibernate等主流Java Web框架。 3. **数据库技术**:精通标准SQL语句,能够使用Oracle、MySQL、SQL Server等多种数据库,并了解NoSQL数据库MongoDB...