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 connect the back end with Directive tag in jsp ...

1 Answers  


List out some advantages of using jsp.

0 Answers  


Java Server Page I can use a function in two ways: Either I declare <jsp:useBean id="myBean" scope="session" class="mypack.mysubpack.MyClass" /> or I declare <%@ page import = "mypack.mysubpack.MyClass" %> In each case I can call a function later by coding MyClass.myFunction(); So what is the difference between the two variantes? Why are Beans invented if we don't need them because we have the import statement ? please guide me its an humble request to you reader if u know n i'll be thankful to you...........

0 Answers  


How to include static files in a JSP page?

0 Answers  


What is translation phase?

0 Answers  






Is jsp page extensible true false?

0 Answers  


how can i get a scjp certification??

3 Answers  


What are jsp lifecycle methods?

0 Answers  


Why do we need custom tags?

0 Answers  


What is taglib uri in jsp?

0 Answers  


What is called jsp directive?

0 Answers  


What is difference between java and jsp?

0 Answers  


Categories