File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes more SCWCD object question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "more SCWCD object question" Watch "more SCWCD object question" New topic

more SCWCD object question

Joe Man
Ranch Hand

Joined: Feb 17, 2002
Posts: 71
12.7 Identify the method in the custom tag handler that accesses:
* A given JSP page's implicit variable
* The JSP page's attributes
1. All the (doStartTag(), doAfterBody(), doEndTag()) can access the JSP page's implict variable right? I guess i don't understand what they mean by which implicit variable.
2. Only the get and set method of the Attribute methods inside tag handler can access the JSP page's attributes? or they mean something else when they say page attributes?

Any feedback would be great! thanks!

Sun Certified Web Component Developer for the J2EE Platform<br />Sun Certified Programmer for the Java 2 Platform
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
1) No, not directly, it must use the PageContext Object to get access to the implicate Objects on a JSP Page
2) No, Tags have to use the PageContext to locate attributes from any scope.
All tags are created with a PageContext Object, this object provides access to the objects that exist on a JSP Page. So, to get at say the Session Object from a JSP Page you need:
HttpSession session = pageContext.getSession();
There are methods in PageContext for getRequest, getOut, getResponse, getPage etc.
To locate an attribute, PageContext has the methods
findAttribute(String name) which will find it in any of the scopes searching in order: page, request, session and application
getAttribute(String name) which only looks at the page scope
getAttribute(String name, int scope) which will find it in the scope specified. PageContext has a set of static variables to ease the definition of the scopes :
[ May 20, 2002: Message edited by: Carl Trusiak ]

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
I agree. Here's the link:
subject: more SCWCD object question
It's not a secret anymore!