On 05.01.11 14:12, "Markus Joschko" <markus.josc...@gmail.com> wrote:
>But, when I understand the documentation of the PostServlet correctly
>you have to explicitely
>add an operation parameter to trigger the extension. Can I also
>validate without relying on the client?
>Otherwise the data can get into the repository unvalidated if the
>parameter is forgotten or omitted.

A custom SlingPostProcessor runs after the post servlet has run the
respective post operation, so it works for all operations.

>I wanted to know whether the filter knows enough about an incoming
>request and if the currentNode object
>is available to the filter. So the filter can validate and set request
>attributes which can further be processed by the template.

Yes, the filter gets the SlingHttpServletRequest object (you need to cast
the (Http)ServletRequest object). Then you have access to the Resource of
the current request:

Resource res = slingRequest.getResource();

To get the node, you need to use the adapt mechanism (the currentNode in
JSPs/ESPs is only one of the variables preset in the script engines):

Node node = res.adaptTo(Node.class);

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel




Reply via email to