aspose file tools*
The moose likes Spring and the fly likes could not able to set the property from the springapp-servlet.xml throws Failed to convert property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "could not able to set the property from the springapp-servlet.xml throws Failed to convert property " Watch "could not able to set the property from the springapp-servlet.xml throws Failed to convert property " New topic
Author

could not able to set the property from the springapp-servlet.xml throws Failed to convert property

gopal krishnan
Greenhorn

Joined: Dec 17, 2007
Posts: 18
i am trying to set the value from the springapp-servlet.xml and it fails to set the property by giving error message

Failed to convert property value of type [java.lang.String] to required type [ProductManager] for property 'productManager'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.lang.String] to required type [ProductManager] for property 'productManager': no matching editors or conversion strategy found

my code
---------

springapp-servlet.xml
---------------------------------





SimpleProductManager
------------------------------

Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1680
    
    7




Your ProductManager property in your controller is of type ProductManager yet you are trying to assign the String "productManager" to it. Use ref instead of value here to reference the bean of type ProductManager with an id of "productManager".


[How To Ask Questions][Read before you PM me]
gopal krishnan
Greenhorn

Joined: Dec 17, 2007
Posts: 18
Thanks the ref has worked..

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17259
    
    6

gopal krishnan wrote:Thanks the ref has worked..



Just think of it like this. In the xml config. value sets it to the exact String value. And ref is to reference another bean which is to be used to set.

So value=String value literal
ref=another bean is sent, with that String name.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: could not able to set the property from the springapp-servlet.xml throws Failed to convert property