You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/05/07 08:54:52 UTC

[jira] Resolved: (STR-1604) RequestProcessor : Populating non-String Bean fields

     [ http://issues.apache.org/struts/browse/STR-1604?page=all ]
     
Don Brown resolved STR-1604:
----------------------------

    Resolution: Won't Fix
     Assign To: Don Brown  (was: Ted Husted)

Closing as won't fix as there were no more opinions.  :)

> RequestProcessor : Populating non-String Bean fields
> ----------------------------------------------------
>
>          Key: STR-1604
>          URL: http://issues.apache.org/struts/browse/STR-1604
>      Project: Struts Action 1
>         Type: Improvement

>   Components: Core
>     Versions: Nightly Build
>  Environment: Operating System: All
> Platform: All
>     Reporter: Ben Hood
>     Assignee: Don Brown
>     Priority: Minor
>  Attachments: conversion_plugin.tar.gz
>
> Hallo,
> I'm very new to MVC Frontends but thing I have noticed is that many struts
> applications replicate business objects through forms, which are just the
> string representation of the business data.
> I have noticed that there has been some discussion about automatically
> populating non-String Bean fields through the RequestProcessor facility.
> Therefore I am submitting a working sugestion, which may or may not seem
> sensible. As I said, this is just a first version of a solution to a
> problem that I am confronted with in a productive situation, so there are
> many details which would need to brushed up, if this approach was to be
> followed any further (e.g. XML-Configuration, Default configurations,
> creating a separate RequestProcessor, examples, testing, etc).
> Briefly:
> - I tentatively called this the FromString plugin (because that's what it
> does).
> - It uses the plugin mechanism.
> - For speeds sake, I patched the RequestProcessor and the RequestUtils
> (although one could create a separate RP, but I didn't because I gathered
> through various discussion threads that the RP interface is going to be
> changed - but correct if I'm wrong).
> - It has a static configuration at the moment (so any further developement
> would need to use the Digester mechanism).
> - Because of this static config, the package contains a TestForm, in order
> to prevent a cyclical dependency during deployment (for testing).
> - It just provides the String2java.util.Date conversion at the moment.
> - It has been tested with a simple JSP that sets a bean field of the type
> java.util.Date
> - The plugin essentially defines a collection of conversion services, which
> can be configured at the field level of any given bean.
> - For example, Bean XXX has fields 1 to n, where field i is a Date field.
> Therefore the field[i] of XXXBean is mapped to Conversion object which is
> invoked when the Bean gets populated after the View form has been
> submitted.
> - Of course, Conversion objects can be reused and one can map any number of
> fields in any bean.
> - (Maybe I've forgotten something, but I don't think so)
> As I mentioned above, I would like to use such a mechanism in production
> code, but if anybody feels that this kind of thing might be useful for the
> general framework, I would quite happy to brush it up and submit it as open
> source code, rather than just implementing proprietry code (of course
> taking any further suggestions into account).
> Cheers,
> Ben

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira