Full annotation mode configuration Springmvc

Source: Internet
Author: User
Tags aop

1. Notes on the three layer of the Java EE:

Presentation layer: @Controller Business layer:

@Service Persistence layer:

@Repository Other:

@Component

Note the effect requires several parties:

1. Need an annotation

2. Where to paste directly

3. The third scanning procedure.

Steps:

1. Turn on the annotation scan <context:component-scan base-package= "Com._520it.springmvc.hello"/> Where to scan, this is to scan a package (if all the scan how to match)

2. Paste the corresponding annotation @controller annotation on the corresponding class.

3. Start the error, you need to import AOP-related packages.

Summary:

Configure the scan in the configuration file:

<context:component-scan base-package= "xxx"/>

Using the full annotation method, the foreground pass parameters will be automatically encapsulated in the background write parameters, do not need to manually get

To guide an AOP package

Full annotation mode configuration Springmvc

Related Article

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.