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

Answers were Sorted based on User's Feedback



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

Answer / vij

${person.name}

Is This Answer Correct ?    1 Yes 0 No

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

Answer / sandeep

using get methods

Is This Answer Correct ?    1 Yes 0 No

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

Answer / nowsheen

I think using EL expressions can be used .

El expressions internally uses getAttribute method to
retrive the values in jsp by using custom tags

Is This Answer Correct ?    0 Yes 0 No

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

Answer / 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

More JSP Interview Questions

How to disable scripting?

0 Answers  


What is the difference between a jspwriter and a servlet printwriter?

0 Answers  


What is the scope of response object?

0 Answers  


How do I run a jsp file in linux?

0 Answers  


What is the different between servlet and struts

2 Answers  


What are implicit objects?

9 Answers  


What is expression language injection?

0 Answers  


What is server context?

0 Answers  


What is jstl?

0 Answers  


What is tld file?

0 Answers  


When does a container initialize multiple jsp objects?

0 Answers  


What are the steps involved in reading data from a form using jsp?

0 Answers  


Categories