denying user from loading a page

Hi,

Is there a way for me to abort the loading of a page (ie, if they do not have permission to view it)? As a wild guess I unsuccessfully tried:

if (<admin check here>)

{

super.destory();

destroy();

}

It did not work.

Any ideas?

Thanks!

[389 byte] By [aperson] at [2007-11-26 11:54:03]
# 1
Btw, I put that code in the init method.Message was edited by: aperson
aperson at 2007-7-7 12:11:30 > top of Java-index,Development Tools,Java Tools...
# 2

Not sure I understand what you are actually attempting to accomplish, but you can easily check in either the preprocess() (page has been posted but no processing has taken place) or you could do the test in the prerender(), or even init() if you want to handle the incoming http directly.You should just redirect the user to a 'the page you requested is not available'. You need to provide some kind of response to the browser, even if you send a '404 forbidden' directly. Don't forget to stop the Faces processing if you send a non-faces response.

MWH@Keystroke at 2007-7-7 12:11:30 > top of Java-index,Development Tools,Java Tools...
# 3
"even if you send a '404 forbidden' directly."" Don't forget to stop the Faces processing if you send a non-faces response."Could you tell me how to do these?Thanks!
aperson at 2007-7-7 12:11:30 > top of Java-index,Development Tools,Java Tools...
# 4
You can use filter for that. Check this out: http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=50520
discusfish at 2007-7-7 12:11:30 > top of Java-index,Development Tools,Java Tools...
# 5
Thanks for the responses!I ended up binding the "rendered" property of the important parts of the page to an "isAdmin" property in the user's session bean.Does anyone foresee any problems with this?
aperson at 2007-7-7 12:11:30 > top of Java-index,Development Tools,Java Tools...