• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

more SCWCD object question

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
12.7 Identify the method in the custom tag handler that accesses:
* A given JSP page's implicit variable
* The JSP page's attributes
Question:
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!
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 :
APPLICATION_SCOPE, PAGE_SCOPE, REQUEST_SCOPE etc.
[ May 20, 2002: Message edited by: Carl Trusiak ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic