Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Define Composition.

918


How do I use a scriptlet to initialize a newly instantiated bean?

903


Mention the implicit objects in a jsp.

949


What do cookies mean?

797


What is scripting elements in jsp?

884


Can I run jsp on xampp?

878


Can we use the exception implicit object in any jsp page?

847


Which two interfaces does the javax servlet jsp package have?

1090


Explain the jsp life cycle?

897


What is scriptlet in jsp?

925


What are implicit objects in jsp?

893


How to ignore the el expression evaluation in a jsp?

888


Why is _jspservice() method starting with an '_' while other life cycle methods do not?

915


Can we use jsp implicit objects in a method defined in jsp declaration?

916


Is jsp server side scripting language?

931