File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes jsp:usebean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp:usebean" Watch "jsp:usebean" New topic


Deepika Wadhwa
Ranch Hand

Joined: Aug 05, 2000
Posts: 57

Hi all,
I want to prevent the Bean from being available for use to any scriptlet defined within a JSP page, Which one of the following <jsp:useBean> scope attributes should i use ?
2) request
or any other ?
thanx in advance,
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
If I am understanding your question correctly, you can't.
A single JSP page gets turned into a servlet class with a monster _jspService method that contains all of the scriptlet code bits.
Any bean will be accessible throughout _jspService.
On the other hand if you mean that you want the use of the bean restricted to a particular request-response cycle, use page or request scope.

author of:
I agree. Here's the link:
subject: jsp:usebean
It's not a secret anymore!