Re: onRequest and res.stop();
"Maksim Lin for technical support mailling lists" <[email protected]>
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <[email protected]> |
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 > > >