velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Choon Chern, Lim" <>
Subject Couldn't retrieve value from Struts bean
Date Thu, 03 Aug 2006 03:00:13 GMT


I'm currently using Struts and Velocity, where the vm
file gets the Struts ActionForm to populate the form

I have a macro as below:-

#macro( datetime $var )
	<input type="text" name="${var}Date"
value="$form.bean.${var}Date" /> 

I made a call in my HTML as below:-


The associated form bean for this page contains a
String field called "visitDate".

When the macro resolves, I'm seeing this:-

<input type="text" name="visitDate"
value="org.meteoric.FrmVisit@32f76519.visitDate" />

It doesn't resolve the value part.

So, I tried hardcoding it this way to test:-

<input type="text" name="visitDate"
value="$form.bean.visitDate" /> 

... and it retrieves the date from the bean and
display properly in the value property.

How do I fix my macro to achieve my desired result?



Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message