I usually do it like this in the bean,

private int id = 0 ;

with the getter method here :

public int getId() {
return id ;
}

and the associated setter method:

public void setId(int input) {
id = input ;
}
.
Is yours something like that by any chance ?


Mariano García wrote:


Your proposal before was fine:

<bean:write name="Bean" property="property"/>

However not too sure about if the get method needs to return a String in
order Java can actually make nicely reflection over the Bean. Otherwise I
guess you would get a "Not accesor method found...".

Why do you actually returns a int value?




My problem is that I don't know how to call that method. If the method is: public int getID (String str) Tag should be: <bean:write name="Bean" property="ID"/>

But... where I put str parameter? I don’t understand this very well. This
method should return a ID value depending "str" value.


Respect to return a int value, Tags API says this: <bean:write> Retrieve the value of the specified bean property, and render it to the current JspWriter as a String by the ways: 1. [...] 2. [...] 3. [...] 4. Otherwise, the usual toString() conversions will be applied.

So, I think the method can return an int value. But I can change it for a
String value.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to