澳门新葡亰娱乐网站-www.142net-欢迎您

澳门新葡亰娱乐网站是因为你还没有找到一条正确的致富之路,www.142net是将所有的游戏都汇集在一起的官方平台,因为澳门新葡亰娱乐网站这个网站当中有着大量的游戏攻略,托IP定位技术,传达终端直接到达的精准传播方式。

配置方式,用注解方式配置Spring

来源:http://www.bhtsgq.com 作者:计算机知识 人气:179 发布时间:2019-05-30
摘要:索引: 索引: 依照005第22中学的办法,若是多少个站点设计有1000个请求,那就得写1000个controller,还得配置一千个 bean id="helloController" class="net.sonng.mvcdemo.controller.HelloController" /bean ,那

索引:

索引:

依照005第22中学的办法,若是多少个站点设计有1000个请求,那就得写1000个controller,还得配置一千个<bean id="helloController" class="net.sonng.mvcdemo.controller.HelloController" ></bean>,那么些职业量无疑无需。

http://www.cnblogs.com/leiOOlei/p/3725911.html#s1

商业开垦实战总计--lm.solution

商业开采实战计算--lm.solution

实则,还足以经过评释实现,用@Controller申明将1个类钦点为Controller,就绝不完结Controller接口,也毫不一定是ModelAndView handleRequest(HttpServletRequest,HttpServletResponse)以此艺术签名了;用@RequstMapping将请求映射到艺术上,也就不用那一千条配置了

一 XML,使用tx标签配置拦截器完毕业务
2 Annotation方式

配置方式,用注解方式配置Spring。参照代码 GitHub:

参照他事他说加以考察代码 GitHub:

将005第22中学的HelloController改成上面那样:

solution/pom.xml

solution/pom.xml

package net.sonng.mvcdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller //该注解表明这是个Controller,这个类也就不用实现Controller接口了
public class HelloController {

    @RequestMapping(value="/hello")  //这个注解替代了xml中SimpleUrlHandlerMapping的配置,将请求映射到处理方法上
    public ModelAndView hello(){  //方法签名完全不用遵循handleRequest,返回值和形参也都可以不同
        ModelAndView mav=new ModelAndView();
        mav.getModel().put("msg", "这是Model中的数据,这是hello方法");
        mav.setViewName("hello");
        return mav;
    }
    @RequestMapping(value="/world") //采用注解配置,一个Controller内可以包含多个方法,对应多个不同的请求
    public ModelAndView world(){
        ModelAndView mav=new ModelAndView();
        mav.getModel().put("msg", "这是Model中的数据,这是world方法");
        mav.setViewName("hello");
        return mav;
    }
}

solution/webapi/pom.xml

web/pom.xml

xml配置改为这样

solution/mapper/pom.xml

web.xml

    <!-- 开启组件注解扫描,扫描base-package值下面的类或子包下的类,包含了特定注解的类就注解为Spring的Bean 
         比如,上面的Controller,就将其注册为Controller组件;除此之外还有@Service、@Conponent、@Repository等-->
    <context:component-scan base-package="net.sonng.mvcdemo" />
    <!-- 这是annotation类型的处理映射器,根据请求查找映射 -->
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" />
    <!-- 这是annotation类型的处理器适配器,完成对hello和world方法的调用 -->
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" />
    <!-- 视图解析器 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
        <property name="prefix" value="/WEB-INF/content/" />
        <property name="suffix" value=".jsp" />
    </bean>

web.xml

WebInitializer.java

布局以上代码后,到浏览器中访问:http://localhost:8080/mvcdemo/hello和http://localhost:8080/mvcdemo/world

spring-mvc.xml

WebConfig.java

Spring MVC的试行流程

  1. 用户向服务器发出请求,被DispatcherServlet截获
  2. DispatcherServlet对请求的url举办深入分析,调用handlerMapping(RequestMappingHandlerMapping)获得有关的靶子,比方Handler对象、对应的拦截器对象,封装到HandlerExecutionChain对象中回到
  3. DispatcherServlet选取三个HandlerAdapter,用于拍卖地点重返Handler对象,调用Handler处理请求的法子,比方hello和world方法
  4. 实践handler(Controller),此前还有些预管理,比如参数类型转变,传上来的json/xml数据转成对象,大概将传上来的数据封装成一个实体对象等
  5. handler实践达成,向DispatcherServlet再次来到三个ModelAndView对象(或然其它对象)
  6. 依据重回的目的,找个方便的ViewResolver视图深入分析器,再次回到给DispatcherServlet
  7. 视图分析器依据Model和View生成结果
  8. 将结果回到给客户端

其他:
地点xml配置中的那两行:

    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" />
    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" />

在Spring 四.0现在,能够用下边一行配置取代,当然注意不要少了mvc的命名空间

<mvc:annotation-driven />

spring-context.xml

RootConfig.java

dbconfig.properties

一、引进须要类库

log4j.properties

  spring-context

RESTfulController.java

  spring-context-support

壹、要点教师

  spring-webmvc:引进该包后,maven 会自动深入分析依赖,引进 spring-web 等包。

  壹.引进创设 spring 、spring mvc 的框架类库

  1.solution/pom.xml

  spring-context:因依靠 会自动引进 spring-aop spring-beans spring-core spring-expression 三个包

  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3     <modelVersion>4.0.0</modelVersion>
  4 
  5     <groupId>lm.solution</groupId>
  6     <artifactId>solution</artifactId>
  7     <version>1.0-SNAPSHOT</version>
  8     <modules>
  9         <module>webapi</module>
 10         <module>web</module>
 11         <module>common</module>
 12         <module>service</module>
 13         <module>mapper</module>
 14         <module>pojo</module>
 15         <module>console</module>
 16         <module>webservice</module>
 17     </modules>
 18     <packaging>pom</packaging>
 19 
 20     <name>solution</name>
 21     <url>http://maven.apache.org</url>
 22 
 23     <properties>
 24         <!--编译字符集-->
 25         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 26         <!-- spring -->
 27         <spring.version>4.3.13.RELEASE</spring.version>
 28         <!-- log4j -->
 29         <slf4j.version>1.7.7</slf4j.version>
 30         <log4j.version>1.2.17</log4j.version>
 31         <!-- jackson -->
 32         <jackson.version>2.9.4</jackson.version>
 33         <!-- junit -->
 34         <junit.version>4.12</junit.version>
 35         <!-- aspectj -->
 36         <aspectj.version>1.8.13</aspectj.version>
 37         <!-- cglib -->
 38         <cglib.version>3.1</cglib.version>
 39         <!-- mybatis -->
 40         <mybatis.version>3.4.5</mybatis.version>
 41         <!-- mybatis-spring -->
 42         <mybatisSpring.version>1.3.1</mybatisSpring.version>
 43         <!--mysql-connector-->
 44         <mysql.version>5.1.34</mysql.version>
 45         <!--druid-->
 46         <druid.version>1.0.5</druid.version>
 47         <!--javax.servlet-->
 48         <javaxServlet.version>3.0.1</javaxServlet.version>
 49         <!--jsp-api-->
 50         <jspApi.version>2.2</jspApi.version>
 51         <!--jstl-->
 52         <jstl.version>1.2</jstl.version>
 53         <!--json-lib-->
 54         <jsonLib.version>2.1</jsonLib.version>
 55         <!--jackson old-->
 56         <jacksonOld.version>1.9.13</jacksonOld.version>
 57         <!--dom4j-->
 58         <dom4j.version>1.6.1</dom4j.version>
 59         <!--ehcache core-->
 60         <ehcacheCore.version>2.6.9</ehcacheCore.version>
 61         <!--ehcache web-->
 62         <ehcacheWeb.version>2.0.4</ehcacheWeb.version>
 63         <!--commons-fileupload-->
 64         <commonsFileupload.version>1.3.1</commonsFileupload.version>
 65         <!--commons-io-->
 66         <commonsIo.version>2.4</commonsIo.version>
 67         <!--commons-codec-->
 68         <commonsCodec.version>1.9</commonsCodec.version>
 69         <!--commons-collections4-->
 70         <commonsCollections4.version>4.0</commonsCollections4.version>
 71         <!--commons-beanutils-->
 72         <commonsBeanutils.version>1.7.0</commonsBeanutils.version>
 73         <!--freemarker-->
 74         <freemarker.version>2.3.19</freemarker.version>
 75         <!-- poi  poi-ooxml -->
 76         <poi.version>3.9</poi.version>
 77         <!--org.apache.httpcomponents-->
 78         <httpcore.version>4.4.8</httpcore.version>
 79         <httpclient.version>4.5.4</httpclient.version>
 80         <!-- jaxws-rt -->
 81         <jaxwsRt.version>2.3.0</jaxwsRt.version>
 82         <!-- jedis -->
 83         <jedis.version>2.9.0</jedis.version>
 84         <!-- rabbitmq -->
 85         <amqpClient.version>5.1.2</amqpClient.version>
 86         <!--fastjson-->
 87         <fastjson.version>1.2.46</fastjson.version>
 88         <!-- jsr250 -->
 89         <jsr250.version>1.0</jsr250.version>
 90     </properties>
 91 
 92     <dependencies>
 93         <!--单元测试依赖 -->
 94         <dependency>
 95             <groupId>junit</groupId>
 96             <artifactId>junit</artifactId>
 97             <version>RELEASE</version>
 98             <!--test 说明这个包的存活是在test周期,也就是发布时将不包含这个jar包-->
 99             <scope>test</scope>
100         </dependency>
101         <!--spring单元测试依赖 -->
102         <dependency>
103             <groupId>org.springframework</groupId>
104             <artifactId>spring-test</artifactId>
105             <version>${spring.version}</version>
106             <scope>test</scope>
107         </dependency>
108         <!-- spring -->
109         <dependency>
110             <groupId>org.springframework</groupId>
111             <!-- 因依赖 会自动引入 spring-aop spring-beans spring-core spring-expression 四个包 -->
112             <artifactId>spring-context</artifactId>
113             <version>${spring.version}</version>
114         </dependency>
115         <dependency>
116             <groupId>org.springframework</groupId>
117             <artifactId>spring-context-support</artifactId>
118             <version>${spring.version}</version>
119         </dependency>
120         <dependency>
121             <groupId>org.springframework</groupId>
122             <artifactId>spring-aspects</artifactId>
123             <version>${spring.version}</version>
124         </dependency>
125         <dependency>
126             <groupId>org.springframework</groupId>
127             <artifactId>spring-tx</artifactId>
128             <version>${spring.version}</version>
129         </dependency>
130         <dependency>
131             <groupId>org.springframework</groupId>
132             <artifactId>spring-jdbc</artifactId>
133             <version>${spring.version}</version>
134         </dependency>
135         <!-- aspectj AOP -->
136         <dependency>
137             <groupId>org.aspectj</groupId>
138             <artifactId>aspectjrt</artifactId>
139             <version>${aspectj.version}</version>
140         </dependency>
141         <dependency>
142             <groupId>org.aspectj</groupId>
143             <artifactId>aspectjweaver</artifactId>
144             <version>${aspectj.version}</version>
145         </dependency>
146         <!-- 映入JSON jackson -->
147         <dependency>
148             <groupId>com.fasterxml.jackson.core</groupId>
149             <artifactId>jackson-annotations</artifactId>
150             <version>${jackson.version}</version>
151         </dependency>
152         <dependency>
153             <groupId>com.fasterxml.jackson.core</groupId>
154             <artifactId>jackson-databind</artifactId>
155             <version>${jackson.version}</version>
156         </dependency>
157         <dependency>
158             <groupId>com.fasterxml.jackson.core</groupId>
159             <artifactId>jackson-core</artifactId>
160             <version>${jackson.version}</version>
161         </dependency>
162         <dependency>
163             <groupId>com.fasterxml.jackson.dataformat</groupId>
164             <artifactId>jackson-dataformat-xml</artifactId>
165             <version>${jackson.version}</version>
166         </dependency>
167         <!-- 日志文件管理包 -->
168         <dependency>
169             <groupId>log4j</groupId>
170             <artifactId>log4j</artifactId>
171             <version>${log4j.version}</version>
172         </dependency>
173         <dependency>
174             <groupId>org.slf4j</groupId>
175             <artifactId>slf4j-api</artifactId>
176             <version>${slf4j.version}</version>
177         </dependency>
178         <dependency>
179             <groupId>org.slf4j</groupId>
180             <artifactId>slf4j-log4j12</artifactId>
181             <version>${slf4j.version}</version>
182         </dependency>
183     </dependencies>
184 
185     <dependencyManagement>
186         <dependencies>
187             <!--spring web-->
188             <dependency>
189                 <groupId>org.springframework</groupId>
190                 <artifactId>spring-web</artifactId>
191                 <version>${spring.version}</version>
192             </dependency>
193             <dependency>
194                 <groupId>org.springframework</groupId>
195                 <artifactId>spring-webmvc</artifactId>
196                 <version>${spring.version}</version>
197             </dependency>
198             <!--cglib-->
199             <dependency>
200                 <groupId>cglib</groupId>
201                 <artifactId>cglib</artifactId>
202                 <version>${cglib.version}</version>
203             </dependency>
204             <!-- mybatis -->
205             <dependency>
206                 <groupId>org.mybatis</groupId>
207                 <artifactId>mybatis</artifactId>
208                 <version>${mybatis.version}</version>
209             </dependency>
210             <dependency>
211                 <groupId>org.mybatis</groupId>
212                 <artifactId>mybatis-spring</artifactId>
213                 <version>${mybatisSpring.version}</version>
214             </dependency>
215             <!-- Mysql数据库驱动包 -->
216             <dependency>
217                 <groupId>mysql</groupId>
218                 <artifactId>mysql-connector-java</artifactId>
219                 <version>${mysql.version}</version>
220             </dependency>
221             <!-- connection pool -->
222             <dependency>
223                 <groupId>com.alibaba</groupId>
224                 <artifactId>druid</artifactId>
225                 <version>${druid.version}</version>
226                 <!--<scope>runtime</scope>-->
227             </dependency>
228             <!--servlet-->
229             <dependency>
230                 <groupId>javax.servlet</groupId>
231                 <artifactId>javax.servlet-api</artifactId>
232                 <version>${javaxServlet.version}</version>
233                 <scope>provided</scope>
234             </dependency>
235             <dependency>
236                 <groupId>javax.servlet.jsp</groupId>
237                 <artifactId>jsp-api</artifactId>
238                 <version>${jspApi.version}</version>
239                 <scope>provided</scope>
240             </dependency>
241             <dependency>
242                 <groupId>javax.servlet</groupId>
243                 <artifactId>jstl</artifactId>
244                 <version>${jstl.version}</version>
245             </dependency>
246             <!-- 映入JSON lib -->
247             <dependency>
248                 <groupId>net.sf.json-lib</groupId>
249                 <artifactId>json-lib</artifactId>
250                 <version>${jsonLib.version}</version>
251                 <classifier>jdk15</classifier>
252             </dependency>
253             <!-- jackson old -->
254             <dependency>
255                 <groupId>org.codehaus.jackson</groupId>
256                 <artifactId>jackson-core-asl</artifactId>
257                 <version>${jacksonOld.version}</version>
258             </dependency>
259             <dependency>
260                 <groupId>org.codehaus.jackson</groupId>
261                 <artifactId>jackson-mapper-asl</artifactId>
262                 <version>${jacksonOld.version}</version>
263             </dependency>
264             <!-- 用dom4j解析xml文件 -->
265             <dependency>
266                 <groupId>dom4j</groupId>
267                 <artifactId>dom4j</artifactId>
268                 <version>${dom4j.version}</version>
269             </dependency>
270             <!-- ehcache -->
271             <dependency>
272                 <groupId>net.sf.ehcache</groupId>
273                 <artifactId>ehcache-core</artifactId>
274                 <version>${ehcacheCore.version}</version>
275             </dependency>
276             <dependency>
277                 <groupId>net.sf.ehcache</groupId>
278                 <artifactId>ehcache-web</artifactId>
279                 <version>${ehcacheWeb.version}</version>
280             </dependency>
281             <!-- 上传组件包 -->
282             <dependency>
283                 <groupId>commons-fileupload</groupId>
284                 <artifactId>commons-fileupload</artifactId>
285                 <version>${commonsFileupload.version}</version>
286             </dependency>
287             <dependency>
288                 <groupId>commons-io</groupId>
289                 <artifactId>commons-io</artifactId>
290                 <version>${commonsIo.version}</version>
291             </dependency>
292             <dependency>
293                 <groupId>commons-codec</groupId>
294                 <artifactId>commons-codec</artifactId>
295                 <version>${commonsCodec.version}</version>
296             </dependency>
297             <dependency>
298                 <groupId>org.apache.commons</groupId>
299                 <artifactId>commons-collections4</artifactId>
300                 <version>${commonsCollections4.version}</version>
301             </dependency>
302             <dependency>
303                 <groupId>org.apache.commons</groupId>
304                 <artifactId>commons-lang3</artifactId>
305                 <version>3.3.2</version>
306             </dependency>
307             <!-- commons-beanutils -->
308             <dependency>
309                 <groupId>commons-beanutils</groupId>
310                 <artifactId>commons-beanutils</artifactId>
311                 <version>${commonsBeanutils.version}</version>
312                 <exclusions>
313                     <exclusion>
314                         <groupId>commons-logging</groupId>
315                         <artifactId>commons-logging</artifactId>
316                     </exclusion>
317                 </exclusions>
318             </dependency>
319             <!-- freemarker -->
320             <dependency>
321                 <groupId>org.freemarker</groupId>
322                 <artifactId>freemarker</artifactId>
323                 <version>${freemarker.version}</version>
324             </dependency>
325             <!-- poi -->
326             <dependency>
327                 <groupId>org.apache.poi</groupId>
328                 <artifactId>poi</artifactId>
329                 <version>${poi.version}</version>
330             </dependency>
331             <dependency>
332                 <groupId>org.apache.poi</groupId>
333                 <artifactId>poi-ooxml</artifactId>
334                 <version>${poi.version}</version>
335             </dependency>
336             <!-- org.apache.httpcomponents -->
337             <dependency>
338                 <groupId>org.apache.httpcomponents</groupId>
339                 <artifactId>httpcore</artifactId>
340                 <version>${httpcore.version}</version>
341             </dependency>
342             <dependency>
343                 <groupId>org.apache.httpcomponents</groupId>
344                 <artifactId>httpclient</artifactId>
345                 <version>${httpclient.version}</version>
346             </dependency>
347             <!-- com.sun.xml.ws/jaxws-rt -->
348             <dependency>
349                 <groupId>com.sun.xml.ws</groupId>
350                 <artifactId>jaxws-rt</artifactId>
351                 <version>${jaxwsRt.version}</version>
352             </dependency>
353             <!-- redis.clients/jedis -->
354             <dependency>
355                 <groupId>redis.clients</groupId>
356                 <artifactId>jedis</artifactId>
357                 <version>${jedis.version}</version>
358             </dependency>
359             <!-- com.rabbitmq/amqp-client -->
360             <dependency>
361                 <groupId>com.rabbitmq</groupId>
362                 <artifactId>amqp-client</artifactId>
363                 <version>${amqpClient.version}</version>
364             </dependency>
365             <!-- com.alibaba/fastjson -->
366             <dependency>
367                 <groupId>com.alibaba</groupId>
368                 <artifactId>fastjson</artifactId>
369                 <version>${fastjson.version}</version>
370             </dependency>
371             <!-- javax.annotation/jsr250-api -->
372             <dependency>
373                 <groupId>javax.annotation</groupId>
374                 <artifactId>jsr250-api</artifactId>
375                 <version>${jsr250.version}</version>
376             </dependency>
377         </dependencies>
378     </dependencyManagement>
379 
380     <build>
381         <plugins>
382             <!-- java编译插件 -->
383             <plugin>
384                 <groupId>org.apache.maven.plugins</groupId>
385                 <artifactId>maven-compiler-plugin</artifactId>
386                 <version>3.2</version>
387                 <configuration>
388                     <source>1.8</source>
389                     <target>1.8</target>
390                     <encoding>UTF-8</encoding>
391                 </configuration>
392             </plugin>
393         </plugins>
394 
395         <pluginManagement>
396             <plugins>
397                 <!-- 配置Tomcat插件 -->
398                 <plugin>
399                     <groupId>org.apache.tomcat.maven</groupId>
400                     <artifactId>tomcat8-maven-plugin</artifactId>
401                     <version>3.0-r1756463</version>
402                 </plugin>
403             </plugins>
404         </pluginManagement>
405     </build>
406 
407 </project>

  spring-context-support

  2.web/pom.xml

  spring-aspects

  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3     <parent>
  4         <artifactId>solution</artifactId>
  5         <groupId>lm.solution</groupId>
  6         <version>1.0-SNAPSHOT</version>
  7     </parent>
  8     <modelVersion>4.0.0</modelVersion>
  9     <groupId>lm.solution</groupId>
 10     <artifactId>web</artifactId>
 11     <packaging>war</packaging>
 12     <version>1.0-SNAPSHOT</version>
 13     <name>web Maven Webapp</name>
 14     <url>http://maven.apache.org</url>
 15     <dependencies>
 16         <!--Module-->
 17         <dependency>
 18             <groupId>lm.solution</groupId>
 19             <artifactId>service</artifactId>
 20             <version>1.0-SNAPSHOT</version>
 21         </dependency>
 22         <dependency>
 23             <groupId>lm.solution</groupId>
 24             <artifactId>common</artifactId>
 25             <version>1.0-SNAPSHOT</version>
 26         </dependency>
 27 
 28         <!--Libary-->
 29         <!--spring mvc-->
 30         <dependency>
 31             <groupId>org.springframework</groupId>
 32             <artifactId>spring-webmvc</artifactId>
 33         </dependency>
 34         <!--cglib-->
 35         <dependency>
 36             <groupId>cglib</groupId>
 37             <artifactId>cglib</artifactId>
 38         </dependency>
 39         <!-- mybatis核心包 -->
 40         <dependency>
 41             <groupId>org.mybatis</groupId>
 42             <artifactId>mybatis</artifactId>
 43         </dependency>
 44         <!--mybatis spring 插件 -->
 45         <dependency>
 46             <groupId>org.mybatis</groupId>
 47             <artifactId>mybatis-spring</artifactId>
 48         </dependency>
 49         <!-- Mysql数据库驱动包 -->
 50         <dependency>
 51             <groupId>mysql</groupId>
 52             <artifactId>mysql-connector-java</artifactId>
 53         </dependency>
 54         <!-- connection pool -->
 55         <dependency>
 56             <groupId>com.alibaba</groupId>
 57             <artifactId>druid</artifactId>
 58             <!--<scope>runtime</scope>-->
 59         </dependency>
 60         <!--servlet-->
 61         <dependency>
 62             <groupId>javax.servlet</groupId>
 63             <artifactId>javax.servlet-api</artifactId>
 64             <scope>provided</scope>
 65         </dependency>
 66         <dependency>
 67             <groupId>javax.servlet.jsp</groupId>
 68             <artifactId>jsp-api</artifactId>
 69             <scope>provided</scope>
 70         </dependency>
 71         <dependency>
 72             <groupId>javax.servlet</groupId>
 73             <artifactId>jstl</artifactId>
 74         </dependency>
 75         <!-- 映入JSON lib -->
 76         <dependency>
 77             <groupId>net.sf.json-lib</groupId>
 78             <artifactId>json-lib</artifactId>
 79             <classifier>jdk15</classifier>
 80         </dependency>
 81         <!-- 用dom4j解析xml文件 -->
 82         <dependency>
 83             <groupId>dom4j</groupId>
 84             <artifactId>dom4j</artifactId>
 85         </dependency>
 86         <!-- ehcache -->
 87         <dependency>
 88             <groupId>net.sf.ehcache</groupId>
 89             <artifactId>ehcache-core</artifactId>
 90         </dependency>
 91         <dependency>
 92             <groupId>net.sf.ehcache</groupId>
 93             <artifactId>ehcache-web</artifactId>
 94         </dependency>
 95         <!-- 上传组件包 -->
 96         <dependency>
 97             <groupId>commons-fileupload</groupId>
 98             <artifactId>commons-fileupload</artifactId>
 99         </dependency>
100         <dependency>
101             <groupId>commons-io</groupId>
102             <artifactId>commons-io</artifactId>
103         </dependency>
104         <!-- common others -->
105         <dependency>
106             <groupId>commons-codec</groupId>
107             <artifactId>commons-codec</artifactId>
108         </dependency>
109         <dependency>
110             <groupId>org.apache.commons</groupId>
111             <artifactId>commons-collections4</artifactId>
112         </dependency>
113         <dependency>
114             <groupId>org.apache.commons</groupId>
115             <artifactId>commons-lang3</artifactId>
116         </dependency>
117         <!-- commons-beanutils -->
118         <dependency>
119             <groupId>commons-beanutils</groupId>
120             <artifactId>commons-beanutils</artifactId>
121             <exclusions>
122                 <exclusion>
123                     <groupId>commons-logging</groupId>
124                     <artifactId>commons-logging</artifactId>
125                 </exclusion>
126             </exclusions>
127         </dependency>
128         <!-- freemarker -->
129         <dependency>
130             <groupId>org.freemarker</groupId>
131             <artifactId>freemarker</artifactId>
132         </dependency>
133         <!-- org.apache.httpcomponents -->
134         <dependency>
135             <groupId>org.apache.httpcomponents</groupId>
136             <artifactId>httpcore</artifactId>
137         </dependency>
138         <dependency>
139             <groupId>org.apache.httpcomponents</groupId>
140             <artifactId>httpclient</artifactId>
141         </dependency>
142         <!-- redis.clients/jedis -->
143         <dependency>
144             <groupId>redis.clients</groupId>
145             <artifactId>jedis</artifactId>
146         </dependency>
147         <!-- com.rabbitmq/amqp-client -->
148         <dependency>
149             <groupId>com.rabbitmq</groupId>
150             <artifactId>amqp-client</artifactId>
151         </dependency>
152         <!-- com.alibaba/fastjson -->
153         <dependency>
154             <groupId>com.alibaba</groupId>
155             <artifactId>fastjson</artifactId>
156         </dependency>
157     </dependencies>
158     <build>
159         <finalName>web</finalName>
160 
161         <plugins>
162             <plugin>
163                 <groupId>org.apache.tomcat.maven</groupId>
164                 <artifactId>tomcat8-maven-plugin</artifactId>
165             </plugin>
166         </plugins>
167     </build>
168 </project>

  spring-tx

二、web 配置

本文由澳门新葡亰发布于计算机知识,转载请注明出处:配置方式,用注解方式配置Spring

关键词: 澳门新京葡 spring Spring MVC Spring ...

最火资讯