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 are the steps for creating custom tags in jsp?
What is jsp tag?
Are dialogue tags necessary?
How can the applets be displayed in the jsp? Explain with an example.
How do I run a jsp file in linux?
How can my application get to know when a httpsession is removed?
What is jsp expression language and what are it’s benefits?
What are jsp elements?
What are the elements of jsp?
How to disable session in jsp?
What are the scopes available in
What are advantages of jsp over asp, php, pure servlets and others?
What is context in web application?
How many tags are there in jsp?
What are directives in jsp?