Spring Annotation Learning Codex (i) building a simple Web application good

Source: Internet
Author: User
Transferred from: http://snowolf.iteye.com/blog/577989
Some changes have taken place in recent work, so it is necessary to learn the spring annotations.
On the Internet to find some examples, in general, compared to the soil, most of the reprint excerpt, follow the instructions to get down at all can not run, simply go through this muddy water, here leave thousand imprint.
This time, let's build a very simple Web application, from controller to DAO. Regardless of the implementation, only a clear understanding of the overall architecture is first. In the future, the details of each layer are described in layers.

Related references:
Spring Annotation Learning Codex (i) building a simple Web application
Spring Annotation Learning Codex (ii) control layer Grooming
Spring Annotation Learning Codex (iii) Form page processing
Spring Annotation Learning Codex (IV.) Persistence layer Analysis
Spring Annotation Learning Codex (v) Business Layer transaction processing
Spring Annotation Learning Codex (vi) test
Spring Annotation Learning Codex (vii) Addendum-@ResponseBody, @RequestBody, @PathVariable
Spring Annotation Learning Codex (eight) addendum--@ExceptionHandler



We will use the following jar package:
Reference
Aopalliance-1.0.jar
Commons-logging-1.1.1.jar
Log4j-1.2.15.jar
Spring-beans-2.5.6.jar
Spring-context-2.5.6.jar
Spring-context-support-2.5.6.jar
Spring-core-2.5.6.jar
Spring-tx-2.5.6.jar
Spring-web-2.5.6.jar
Spring-webmvc-2.5.6.jar

See Web. XML first
XML code    <?xml version= "1.0"  encoding= "UTF-8"?>   <web-app       xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"         xmlns= "Http://java.sun.com/xml/ns/javaee"        xmlns:web= "http// Java.sun.com/xml/ns/javaee/web-app_2_5.xsd "       xsi:schemalocation=" http// Java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "        id= "webapp_id"        version= "2.5" >        <display-name>spring</display-name>       <!--  Application path  -->       <context-param>            <param-name>webAppRootKey</param-name>            <param-value>spring.webapp.root</param-value>       </context-param>        <!-- Log4J  configuration   -->        <context-param>           <param-name> log4jconfiglocation</param-name>           < param-value>classpath:log4j.xml</param-value>       </context-param >       <context-param>            <param-name>log4jRefreshInterval</param-name>            <param-value>60000</param-value>       </ context-param>       <!--Spring context   configuration   -->       <context-param>           <param-name> contextconfiglocation</param-name>           < param-value>/web-inf/applicationcontext.xml</param-value>       </ context-param>       <!--  Character Set   filters   -->       <filter>           < filter-name>characterencodingfilter</filter-name>            <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>            <init-param>                <param-name>encoding</param-name>                <param-value>utf-8</param-value>            </init-param>            <init-param>               < param-name>forceencoding</param-name>                <param-value>true</param-value>            </init-param>       </filter>        <filter-mapping>           < filter-name>characterencodingfilter</

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.