Eclipse turn on Mybatis-config.xml profile Smart Tips

Source: Internet
Author: User

Programmers who use Java development often learn, may involve the use of configuration files, when using eclipse like the IDE to edit configuration profiles, if the configuration file does not automatically associate, it is a more annoying thing. The author here to take MyBatis configuration can not automatically prompt for example.

Problem description

The following configuration code can not be automatically prompted in the IDE when you are learning from the official documentation.

<?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>  <Environmentsdefault="Development" >  <EnvironmentId="Development" >   <TransactionManagerType="JDBC"/>   <DataSourceType="Pooled" >    <PropertyName="Driver"Value="${driver}"/>    <PropertyName="url"Value="${url}"/>    <PropertyName="Username"Value="${username}"/>    <PropertyName="Password"value="${password}"/>   </datasource> </  environment>  </environments> <mappers>  <mapper resource= "Org/mybatis/example/blogmapper.xml"/> </mappers></configuration>  
Process steps

1. First need to ensure that the local presence of the corresponding DTD file in the XML file, generally provided in the official download package has been provided, you can also directly access the HTTP://MYBATIS.ORG/DTD/MYBATIS-3-CONFIG.DTD address download to local;

2. Then configure it in the IDE, Window--preference--xml--xml catalog, add,


3. On the Add page the different key type corresponds to a different value, the location represents the local path,





4. Configure the Wencheng after the corresponding configuration file can be prompted,



Postscript

Other similar configuration files can be referred to this idea for processing, should all be done. In the end, the DTD is an effective way to ensure that the XML document is well formed, and you can compare the XML document and the DTD file to see if the document conforms to the specification and whether the elements and labels are used correctly.

Eclipse turn on Mybatis-config.xml profile Smart Tips

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.