You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Christophe Lombart <ch...@gmail.com> on 2009/09/07 17:07:55 UTC

POST esp script

Hi all,

In a POST esp script, I would to redirect to the default POST
processing depending on some conditions.
Is it possible to redirect to the default POST servlet from a esp
script ? I didn't find some examples.

br,
Christophe

Re: POST esp script

Posted by Eric Norman <er...@gmail.com>.
Sure, that should work.  Just make sure to call jcrSession.save() if you
make any JCR updates that should be persisted after the forward.

On Sep 7, 2009 4:36 PM, "Peter Chiochetti" <pc...@myzel.net> wrote:

Am 2009-09-07 17:36, schrieb Eric Norman:

> > Try this: > > <% >    var isValid = true; //TODO: your condition here >
   if (!isValid) { >   ...
will that also let me do revisions without replicating the defaultservlet?
like this:

checkout();
forward();
checkin();

BTW: I did board the sling ship because of the advertisings at the pier.
Though the vessel is large and hallways sparely labelled, so far I am happy.

-- 
peter

Re: POST esp script

Posted by Peter Chiochetti <pc...@myzel.net>.
Am 2009-09-07 17:36, schrieb Eric Norman:
> Try this:
>
> <%
>     var isValid = true; //TODO: your condition here
>     if (!isValid) {
>         //TODO: handle invalid condition here
>     } else {
>        //condition is valid, so forward to the default post servlet to do the
> work.
>        sling.forward(resource.path, "sling/servlet/default");
>     }
> %>

will that also let me do revisions without replicating the 
defaultservlet? like this:

checkout();
forward();
checkin();

BTW: I did board the sling ship because of the advertisings at the pier. 
Though the vessel is large and hallways sparely labelled, so far I am happy.

-- 
peter

Re: POST esp script

Posted by Christophe Lombart <ch...@gmail.com>.
ah yes ! I forgot the location of this method. thanks for your reply

Christophe


2009/9/7 Eric Norman <er...@gmail.com>:
> Hi Christophe,
>
> Try this:
>
> <%
>   var isValid = true; //TODO: your condition here
>   if (!isValid) {
>       //TODO: handle invalid condition here
>   } else {
>      //condition is valid, so forward to the default post servlet to do the
> work.
>      sling.forward(resource.path, "sling/servlet/default");
>   }
> %>
>
> On Mon, Sep 7, 2009 at 8:07 AM, Christophe Lombart <
> christophe.lombart@gmail.com> wrote:
>
>> Hi all,
>>
>> In a POST esp script, I would to redirect to the default POST
>> processing depending on some conditions.
>> Is it possible to redirect to the default POST servlet from a esp
>> script ? I didn't find some examples.
>>
>> br,
>> Christophe
>>
>

Re: POST esp script

Posted by Eric Norman <er...@gmail.com>.
Hi Christophe,

Try this:

<%
   var isValid = true; //TODO: your condition here
   if (!isValid) {
       //TODO: handle invalid condition here
   } else {
      //condition is valid, so forward to the default post servlet to do the
work.
      sling.forward(resource.path, "sling/servlet/default");
   }
%>

On Mon, Sep 7, 2009 at 8:07 AM, Christophe Lombart <
christophe.lombart@gmail.com> wrote:

> Hi all,
>
> In a POST esp script, I would to redirect to the default POST
> processing depending on some conditions.
> Is it possible to redirect to the default POST servlet from a esp
> script ? I didn't find some examples.
>
> br,
> Christophe
>