Hi Matthias,
you're getting the String representation of the serialized version of
the date instance there.
There are several ways to format, you can use your bean:
template.setValue("INPUT:pqeDt", simple_date_formatter.format
(mybean.getPqeDt()));
or deserialize yourself:
Date pqedt = (Date)SerializationUtils.deserializeFromString(getInput
("INPUT:pqeDt"));
template.setValue("INPUT:pqeDt", simple_date_formatter.format(pqedt));
It's probably best to then remove the "INPUT:" prefix for clarity,
thought you can leave it there too.
In general though, if you're working with non-primitive bean
properties, it's a better idea to do everything through the bean. A
lot will be automated for you then. You're able to attach a format
constraint to each property, and if it's not there, the toString()
method will be called. The values will also automatically be HTML
encoded for you.
The steps then simply are:
YourBean bean = getInputBean(YourBean.class);
template.setBean(bean);
You have to remove the "INPUT:" prefix for this though, or call the
setBean method as follows:
template.setBean(bean, "INPUT:");
Best regards,
Geert
On 13-nov-05, at 10:45, Matthias Schmitt wrote:
Hello,
i've got another question:
You have to set them through the Template setBean method, or
prefix the name of each property with 'INPUT:'. Like this:
<h1>DruckLog für Auftrag: <!--V 'INPUT:pqeID'/--></h1>
<table>
<tr><th>Kennung</th><th>Zeitstempel</th><th>Drucker</th><th>Host</th>
<th>Nachricht</th></tr>
<tr><td><!--V 'INPUT:pqeID'/--></td><td><!--V 'INPUT:pqeDt'/--></td>
<td><!--V'INPUT:prnID'/--></td><td><!--V 'INPUT:wksID'/--></td><td>
<!--V 'INPUT:pqeMessage'/--></td></tr>
The second parameter "pqeDt" of my inbean is of type java.util.Date.
Instead of displaying the date,
the template engine gives me something like an hashcode "ADFR4FD8...."
How can i display the date,
and how can i set the format of this date?
--
gruss,
Matthias
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users
--
Geert Bevin Uwyn bvba
"Use what you need" Avenue de Scailmont 34
http://www.uwyn.com 7170 Manage, Belgium
gbevin[remove] at uwyn dot com Tel +32 64 84 80 03
PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users