I've just started using turbine for a GSM SMS payment gateway application
that I am writing. The idea is to allow builders and plumbers and whatever
to take credit card payments using their mobile phone.
Anyway, I'm using turbine for the web side of things and I've run into a
problem with intake.
I am using intake with mapping to my business object. (I don't have my
exact source with me right now, but it is along the lines of)
<group name="Merchant" key="merchant" mapToObject="om.Merchant">
<field name="Merid" key="merid" type="String">
<rule name="minLength" value="8">Merchant Id must be at least 8
long</rule>
<rule name="maxLength" value="16">Merchant Id must not be longer
than 16</rule>
</field>
.
.
.
</group>
I used torque to generate my Merchant business object. The primary key is
the field Merid. The generated MerchantBase class has two methods to set
the Merid:
setMerid(String s), and setMerid(StringKey sk)
In a screen class for a page where I either create or edit a merchant, I
check for a merchant Id as a parameter from the previous request. If no id
exists, then I create a new merchant object and put it in the context for
velocity and also in the ServletContext.
My action class to handle the submission of the form does
Merchant mer =
(Merchant)data.getServletContext().getAttribute("merchant");
Group g = intake.get("Merchant", mer.getMerid());
g.setProperties(mer);
When I call g.setProperties() I am getting an InvocationTargetException at
line 663 in org.apache.turbine.services.intake.model.Field.setProperty().
The problem is that the field is using the method setMerid(StringKey sk),
but is passing in a String.
Why is intake using the setter method that takes a StringKey rather than the
setter method that takes a String?
Thanks,
Joel Hockey
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>