Re: onRequest and res.stop();

"Andreas Schuh" <[email protected]>
Newsgroups gmane.comp.java.helma.general
Message-ID <[email protected]>
hi,

i've upgraded helma from 1.5.3 to 1.6.0-rc1 and now it works fine.
with helma 1.5.3 (java 6) i got ever the same error: stop() is a undefine
function of (res-)object.

thx

andi

> Hi Andreas,
>
> That doesn't sound right - I use res.redirect() in onRequest() in my
apps all the time to handle this kind of user permission checks. Infact
the docs for res.stop() say :
> "...Note that this method is intended for use in the context of an
onRequest handler and not for use inside of actions, which would likely
lead to bad coding practices. "
>
> And I just tried it in a test app and it works ok for me.
>
> Are you sure that the error is definitely coming from the res.stop()
method call ?
>
> Maks.
>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Andreas Schuh Sent:
Thursday, 5 April 2007 23:30
>> To: [email protected]
>> Subject: [Helma-user] onRequest and res.stop();
>>
>> hi list,
>>
>> i try to stop executing the called action after onRequest() function.
>>
>> code:
>>
>> function onRequest() {
>>         if(!hasActionAccess('view', this)) {
>>                 http403(); //render 403 page
>>                 res.stop();
>>         }
>> }
>>
>> but it seems there is no res object available in onRequest
>>
>> TypeError: undefined is not a function.
>> (/srv/helma/apps/mazda_austria_guzza/code/HopObject/class.js; line 43)
>>
>> is there a way to cancel execute the called action in onRequest()?
>>
>> _______________________________________________
>> Helma-user mailing list
>> [email protected]
>> http://helma.org/mailman/listinfo/helma-user
>>
>>
>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.