On Apr 3, 2012, at 6:56 AM, Mike McNally wrote:

> Maybe a simple way to get functionality like this would be to have a
> way to annotate action bean properties (and sub-properties) such that
> an <s:form> tag would implicitly introduce <s:hidden> inputs to map to
> those properties.
> 
> There'd have to be some way for the <s:form> to know which bean
> properties to pay attention to, which would be a little messy.

Iwaos idea is a good interim step, and shows how far you can go with the 
toolset in place. I'd probably just serialize and compress the data than XML 
encode it, but that's simply a matter of taste.

If this were a first class concept, the PageScoped state would have the special 
characteristic of binding first, then everything else would bind later. This is 
likely more what folks want anyway. Bind to the old values, and then stomp on 
them with the new values.

I wouldn't put much effort in to "which fields to bind", as it does complicate 
things. Since the user has control over what it scoped at all, (rather than 
"everything"), I think that gives enough flexibility to the developers without 
putting an undo burden on the PageScope logic. If you as a developer don't want 
something save, then set the fields to null or 0 before you save out.

There would need to be a change to the s:form tag to automatically populate 
this field, or optionally not populate it depending on how you want to go. I'd 
also limit this to only POSTs, just to ensure that it doesn't force its way 
into a GET and end up on the URL.

Or there could be the addition of a new tag solely to place the state data.

If you're willing to do some manual lifting and add your own <input 
type="hidden" name="_pageScope"/>, then this can probably be completely done as 
an add on with some interceptors, with no change at all to stock stripes. Make 
it a StripesStuff feature.

I think if the community was able to pony up a working implementation via 
StripesStuff, the maintainer would be more likely to roll it in to a later 
distribution than simply waiting around for them to implement this out of whole 
cloth. It will give the design some more thought, and some real world testing 
by folks who would actually use the feature in the wild rather than some 
contrived use cases and unit tests made up by someone who, at the moment, has 
no use for it.

Using Iwaos initial example as a starting point and looking at SessionScoped 
should give a lot of insight in to how this could be done without having to be 
an expert on Stripes and its inner workings, making it likely an intermediate 
task for someone interested in showing a sample implementation.

Regards,

Will Hartung


------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to