Friday February 27, 2004
Pictures from Tucson Last weekend, we headed to Tucson, Arizona to visit with family. Here are some good pics from the trip - and one of Abbie with her new kitty.
Cool Trainyard |
El Charro |
Saguaro National Park |
Abbie giving Zoe a kiss |
Posted in General at Feb 27 2004, 10:43:32 PM MST Add a Comment
Generating indexed-property ready ActionForms with XDoclet
One of the issues with using XDoclet
to generate your Struts ActionForms (from POJOs) is that out-of-the-box, your Forms will not support indexed properties. This means that if you have a List on an object (this list will likely contain other objects/forms), you have to extend the generated form to add the necessary setters for indexed properties. For example, if you have an addresses List on a PersonForm, you would need the following in order to edit those addresses in Struts.
setAddresses(int index, Object address) {
|
The worst part is that you need to populate the addresses list with a bunch of empty AddressForm objects before Struts' auto-population will succeed. If you were coding the PersonForm by hand, you could code a reset() method such as the following:
public void reset(ActionMapping mapping, HttpServletRequest request) {
|
Now for the best part - I figured out how to generate this code with XDoclet, so any lists on your Forms will be indexed-property ready. By using <nested:iterate> in your JSP, you can easily CRUD you indexed properties. Pretty slick IMHO. The template is a bit much to put on this site, and it's long lines won't fit in a <pre> - so you can temporarily view the template here
. I'll add a link to it in AppFuse's CVS once it shows up there. One thing you'll notice in this template is a little Velocity-lovin':
<XDtVelocity:generator>
#set( $method = $currentMethod.name)
## trim off the 'get'
#set( $objectName = $method.substring(3, $method.lastIndexOf('s')))
</XDtVelocity:generator>
Thanks to Erik
on Merrick's blog
for the quick Velocity/XDoclet howto. It was especially helpful since the XDoclet site has no documentation
on this feature.
For all you my framework is better junkies - a clear explanation of how your framework handles indexed properties would be appreciated.
Posted in Java at Feb 27 2004, 05:18:10 PM MST 2 CommentsNew Phone? I just got an interesting SMS message from AT&T:
AT&T Wireless: Sony Ericsson and AT&T Wireless have sent you a new T226 phone to replace your current T68 - no strings attached. Questions? Call 800-500-3821.
Wierd eh? Is there something wrong with the T68i? I'll admit that the T226 looks a bit nicer, but when I get a new phone - I'd like to go all out. In other words, I'll be talking to Russ to get his recommendation. Posted in General at Feb 27 2004, 03:10:56 PM MST 4 Comments
Struts 1.2.0 Test Build Available From the struts-dev mailing list:
The Struts 1.2.0 Test Build is now available here: http://www.apache.org/~martinc/struts/v1.2.0/ This is the first Struts build being made available following the same test-and-release process that has been used successfully by the Tomcat team for some time. It is *not* an official Apache release. Once feedback has been collected on the stability and general quality of this build, a determination will be made as to whether it should be promoted to Alpha status.
You can reference the Struts site for a list of what's changed since 1.1. To further assist you (if you're upgrading from 1.1), you might want to check out how I did it back in October. I tested this build with AppFuse and all tests pass - I didn't even have to change a single line of code. For that reason, this is now the Struts version that'll ship with AppFuse 1.4. Posted in Java at Feb 27 2004, 09:06:43 AM MST Add a Comment
Search This Site
Recent Entries
- Choosing an Ajax Framework
- R.I.P. Giant FCR3
- Happy Birthday Mom!
- 2008 - A Year in Review
- Portland Tech Meetup Tomorrow Night
- My "almost slept in a snow cave" Adventure with Clint Foster
- My Christmas Travel Adventure
- AppFuse Light converted to Maven modules, upgraded to Tapestry 5 and Stripes 1.5
- Dojo/Comet support in Java Web Frameworks
- Abbie is a Blue Skier!