how can we retrieve the values in jsp by using custom tags

Answer Posted / shiraz khan

Tag handler class is not a servlet or jsp, so it doesn't
have access to many implicit objects which are available in
jsp. It, however, has a reference to PageContext using which
we can call :
pageContext.getAttribute(name) // looks in page scope only
pageContext.getAttribute(name,scope) // looks in specified
scope

alternatively we can also also get references to other
scopes using :
pageContext.getRequest()
pageContext.getSession()
pageContext.getServletContext()
pageContext.getServletConfig()

And yes, this pageContext implicit object is given to the
tag class by container, during initialisation of this tag
class when setPageContext(PageContext) is called by container

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where is jsp used?

670


What is the use of implicit object named "application" in Application?

1452


What is an implicit object?

660


What is jsp index?

684


What is jsp in javascript?

690


What do you mean by context initialization parameters?

692


What is jsp action tags?

672


What are scripting elements?

737


What is the resourcebundle class in jsp?

671


What is jsp-config in deployment descriptor?

778


What is pagecontext?

731


Which implicit object is not available in normal jsp pages?

649


List out the various scope values of jsp action.

794


Hi, I've applied for HPCL(Information System Officer)& UIIC (A).Plz send me previous/sample papers and any suggestions regarding this exam.Please advice me good study material or related links. Thanks in advance shyam shyamprasad71@gmail.com

2179


What are the different scope values for the jsp objects?

713