WebWork Tip of the Day: Type Conversion when using ModelDriven

Googling for people’s experiences with WebWork rarely turns up any results other than the docs and the equivalent at Struts 2, so most of the time finding out how to do something involves looking at the showcase. However, I found something it doesn’t do today – type conversion in a model driven action.

The trick is to specify your conversion properties on the model itself, not the action as you usually would. Makes plenty of sense now, but I wished I’d figured that out much earlier 🙂

Technorati Tags:

Advertisements

2 responses to “WebWork Tip of the Day: Type Conversion when using ModelDriven

  1. I am struggling with precisely this today. After your hint I was able to get it going by putting the converter on the Model. However, I can’t seem to get the model populated in my save action. The page displays fine, with the iterator showing all the properties of my list. However, when this form is submitted, I can’t get those values in my action bean. Any tips would be appreciated.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s