- The need to introduce Apache.commons.dbcp-1.2.2.osgi.jar and Org.apache.commons.pool-1.5.3.jar to provide JDBC access;
- Need Org.springframework.transaction-3.0.5.release.jar to provide Daosupport class;
- Org.springframework.jdbc-3.0.5.release.jar is used to provide autoware tag bindings when starting mybatis bindings;
- There are also database-driven classes;
ModulePanel, select the project default path is root,but the default should be project name. then the global search "ROOT", only to find the original in the. Settings folder There is a org.eclipse.wst.common.component file, which defines the <?xml version= "1.0" encoding= "UTF-8"? ><project-modules id= "Modulecoreid" project-version= "1.5.0" > < Wb-module deploy-name= "zcm" > <wb-resource deploy-path= "/" source-path= "/target/m2e-wtp/web-resources"/> <wb-resource deploy-path= "/" source-path= "/src/main/webapp" tag= "Defaultrootsource"/> <wb-resource de Ploy-path= "/web-inf/classes" source-path= "/src/main/java"/> <wb-resource deploy-path= "/WEB-INF/classes" sour Ce-path= "/src/main/resources"/> <property name= "Context-root" value= "ROOT "/><property name= "Java-output-path" value= "/zcm/target/classes"/> </wb-module></project-modules>only to know, the original web project pre-name is specified here. As to why it would be root, maybe because when I came down from SVN, I would create an Eclipse project, which was created as root by default,because the default name for other manually created Web projects is the project name. The solution to this problem requires two aspects:
- Using Eclipse 's default tomcat7, verify that the JDK version is Jdk7, which was previously incorrectly specified as a JDK
in the Add Server interface, click Configure Runtime Environments Click Edit ...Follow the JRE version Cleanis to clean work.MyBatisthe resultmap in mapper is a custom type, avoid creating a Vo class, but you can define a temporary object for a query in mapper XML. The object is then associated with the field of an entity class. If the field of the query result can correspond to the entity class one by one can be specified by the development of Resulttype , in fact, in the specified (bean) sqlsessionfactory typealiasespackage field, You have specified an alias that can be omitted so that the class name is written directly in the Resulttype (no previous namespace required) <Bean id= "sqlsessionfactory" class="Org.mybatis.spring.SqlSessionFactoryBean"> <property name= "dataSource" ref="DataSource" /> <property name= "configlocation" value="Classpath:sqlmapConfig.xml"></ Property> <property name= "mapperlocations" value="Classpath:mapper/*mapper.xml"> </Property> < name= "typealiasespackage" value= "com.zcm.mall.vo"></Property > </Bean> or, specify it in the MyBatis configuration file: <? XML version= "1.0" encoding="UTF-8"?> <! DOCTYPE configuration public "-//mybatis.org//dtd Config 3.0//en" "http://mybatis.org/dtd/ Mybatis-3-config.dtd "> <configuration> <typealiases> <package name="Com.zcm.mall.vo"/> </typealiases> </configuration>
A web-based MyBatis project