Self-thinking about spring's applicationcontext.xml configuration file ref and value

Source: Internet
Author: User

Today, when doing an SSH project, because of the need for timed operation, so I added a quartz in the sping inside a small time frame, the result in the runtime, a small bug occurred.

 for  for property ' jobfactory ': no matching editors or conversion strategy found
 for property ' jobfactory ': no matching editors or conversion strategy found

This is a very small bug, I did not think I was just beginning to notice what was wrong.

Error code:

<name= "Jobfactory"  value= "jobfactory"/>

Correct code:

<name= "Jobfactory"  ref= "jobfactory"/>
Did you see that? convert string type to the required class type conversion error

Is that value and ref are wrongly written.

In theory, ref is used in the current XML where <bean> tags have been previously configured, and since my SSH framework uses annotation development, the jobfactory in the annotation @service ("jobfactory") can be used directly.

In the spring configuration file, the parameter of value configuration is usually used in numbers, strings, etc., and cannot be placed on objects. And ref is a reference to the object!

The mistakes made today by this year are very special.

Self-thinking about spring's applicationcontext.xml configuration file ref and value

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.