Frank W. Zammetti wrote:
Hi Antonio,
Antonio Petrelli wrote:
2007/12/13, Frank W. Zammetti <[EMAIL PROTECTED]>:
return mapping.findForward("JSONResultType");
I don't like this syntax, because it mixes the concept of forward (to a
page) with the rendering of the ActionForm. Probably a more specific
ActionMapping method, or different types of ActionForwards, could be
better.
So you'd rather see something like:
return mapping.renderResult("JSON");
Or stick with mapping.findForward(something) but provide a mechanism for
mapping that result type to the appropriate (JSON/XML/etc) rederer in
struts-config.xml. That would eliminate any concern over clashes with
existing action return strings (small though the risk is), and would be
consistent with existing declarative semantics.
With that, it could be easy to make the 'result providers' such as JSON
serialization, XML serialization and so forth plugable/configurable
and/or parameterizable.
For example:
<action name="/orders" ...>
<forward type="json" name="json-brief"/>
<forward type="json" name="json-brief">
<!-- JSON serializer parameters go here -->
</forward>
...
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]