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
What is session setattribute?
Which categories can be divided jstl tags, give examples.
List the different scope values for the
Is jsp used?
How can I prevent direct access to a jsp page from a browser?
What is meant by jsp?
How is scripting disabled?
Define Static Block.
What is the use of jsp implicit objects?
How we can configure init params in jsp?
What is content type in jsp?
HOW CAN WE COMPARE TWO PDF FILES USING JSP ?
Why is _jspservice() method starting with an '_' while other life cycle methods do not?
What is a declaration statement?
Give the use of session object.