Darrell Pittman wrote:
> Bertrand,
> 
> I wouldn't mind taking a crack at something but I'm not sure I'd know
> where to start.  I only just started looking at sling.  I wonder if you
> might have some suggestions.  Here are some problems I have:
> 
> If we went with a request filter the filtered posts, the filter would
> have to be able to resolve a validation resource.  It could then
> validate the request.  If the validation failed, the filter would have
> to know how to re-render the "edit" resource. Would the idea be to have
> the posting form contain some @suffix type fields that the filter could
> use to resolve the validation resource and the "edit" resource?
> 
One possibility is to use a validation servlet instead of filter. You
register
the servlet for POST with a specific selector and then post your form to
your resource with something like ".form.html", e.g. you post to
"/mycontent/cars/ferrari.form.html".

The servlet validates the form values and if the values are invalid just
forwards to re-render the form by using method get
(/mycontent/cars/ferrari.html"). If everything is valid the servlet just
forwards to the sling post servlet.

For registering your servlet, it should set the property
"sling.servlet.selectors" to "form" and the property
"sling.servlet.methods" to POST, so all POST requests having the
selector "form" in the url are handled by this servlet.

HTH
Carsten
-- 
Carsten Ziegeler
cziege...@apache.org

Reply via email to