Various automatic prompts for Java, XML files, annotations, and so on in Eclipse configuration

Source: Internet
Author: User
Tags aop

One, XML file to add automatic prompt function

The automatic prompts for XML files require you to import different related XSD files, and the following is a common beans and context to describe the configuration methods.

1.xml file Add Beans Auto Prompt feature

Eclipse Window Selection

Window–preferences–myeclipse–xml–xml Catalog

Select User Specified entries and click Add

Location: Add the path where the Spring-beans-2.5.xsd file is located

Key Type: Select Schema location

Key: Auto Populate

After confirmation that there is a hint as shown,

2. xml file Add context Auto prompt feature

Similarly

Import related XSD files

If you want to use it, add the following words to the XML file.

<pre name= "Code" class= "JavaScript" >xmlns:context= "Http://www.springframework.org/schema/context"

http ://www.springframework.org/schema/context

http://www.springframework.org/schema/context/ Spring-context-2.5.xsd

<context:annotation-config/>
<span style= "FONT-SIZE:18PX;" ><strong><span style= "color: #ff00;" ></textarea></span></strong></span>

As pictured,

Second, Java file and note automatic prompts

Success. General Java file hints as shown in the diagram,

Note the hint function as shown in the diagram,

However, using the annotation annotation feature also adds a few words to the XML configuration file.

Use annotation must add four sentences as follows,

<pre name= "code" class= "HTML" >xmlns:context= "Http://www.springframework.org/schema/context"          

http:// Www.springframework.org/schema/context   http://www.springframework.org/schema/context/ Spring-context-2.5.xsd

<context:annotation-config/>


As pictured,

<?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:aop=" HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP "   
       xsi:schemalocation=" http:// Www.springframework.org/schema/beans     
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

       Http://www.springframework.org/schema/context   
       http://www.springframework.org/schema/context/ Spring-context-2.5.xsd
       HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP        
       Http://www.springframework.org/schema /aop/spring-aop-2.5.xsd ">

<context:annotation-config/>

<context:component-scan Base-package= "COM.BJSXT"/>

 <aop:aspectj-autoproxy/>

The premise of using a different annotation is that the corresponding jar package has already been imported, and different annotations will be imported in different packages, for example,

@RequestMapping Correspondence Spring-web-3.2.8.release.jar

@Aspect corresponds to Aspectjweaver-1.6.9.jar and Aspectjrt-1.6.9.jar.

The specific version seems to be indifferent, I chose the time is to find the local library version of the latest, it seems that the version of inconsistency is not too much impact

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.