-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Why passing of "int" value via configuration don't work
PostPosted: Thu Mar 15, 2012 8:43 am 
Newbie

Joined: Thu Mar 15, 2012 6:36 am
Posts: 1
Hello Everyone,
I recently started studying springs framework. So as a neophyte my questions will look silly.
It would be great if you can help me with this.

I am trying to pass a int value from the spring configuration file for example :-

<property name="X" value="0.57"/>And my bean class has setters and getters for this property :-

private int X;

public int getX() {
return X;
}

public void setX(int x) {
X = x;
}


When I convert it to string or pass the int value via constructor injection everything works fine but not when I use the method injection to pass the int value.

I read that spring framework does the automatic type conversion. Then why it fails here


Top
 Profile  
 
 Post subject: Re: Why passing of "int" value via configuration don't work
PostPosted: Thu Mar 15, 2012 10:30 am 
Senior
Senior

Joined: Tue Oct 28, 2008 10:39 am
Posts: 196
0.57 is not an int value!

BTW: This forum is about Hibernate not Spring.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.