You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Obster <mi...@obster.org> on 2010/01/11 17:15:04 UTC

[S2] Can't get type conversion running with -tags

Hi,

I've a problem get the type conversion running in connection with a s:select.

I have an action (OrderABCEditAction.java) with a
"List<User> userlist;"
variable and corresponding getter and setter. Then I do a
<s:select id="leftSignature" name="order.orderABC.leftSignature"
list="userlist" listKey="id" listValue="%{displayName}" headerKey="-1"
headerValue=""/>
in the order_abc.jsp.

Then I have created a OrderABCEditAction-conversion.properties in the same
directory where my OrderABCEditAction.java is located with the following
content:
order.orderABC.leftSignature=de.eposcat.apbb.ui.converters.UserTypeConverter

The select field is populated with the values of the list. But when I try
to save I get a NoSuchMethodException setLeftSignature(String value),
which is correct, because only a method setLeftSignature(User value) is
existing.

After adding a System.out.println I have seen, that my converter does not
run. So I tried to implement an attribute leftsignature directly into my
OrderABCEditAction and changed the properties file and jsp to :
leftSignature=de.eposcat.apbb.ui.converters.UserTypeConverter
and
<s:select id="leftSignature" name="leftSignature" list="userlist"
listKey="id" listValue="%{displayName}" headerKey="-1" headerValue=""/>

This works, but why is the converter ignored if i use a nested property?

Regards,
Michael





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org