• Post Reply Bookmark Topic Watch Topic
  • New Topic

name-from-attribute doubt

 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to use name-from-attribute in variable directive?
what should be the value of name-from-attribute?
 
Kumar Garlapati
Ranch Hand
Posts: 38
 
Kumar Garlapati
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example:

varAttr.tag
------------
<%@ attribute name="v" required="true" %>
<%@ variable name-from-attribute="v"
variable-class="java.lang.Long"
alias="a" scope="AT_END" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="a" value="${123}"/>
<p> TAG: ${v} = ${a} </p>

varAttr.jsp
-------------
<%@ taglib prefix="demo" tagdir="/technology/WEB-INF/tags/demo" %>
<demo:varAttr v="x"/>
<p> JSP: x = ${x} </p>

output:
--------
TAG:x = 123
JSP:x = 123

Reference : http://www.oracle.com/technology/pub/articles/cioroianu_tagfiles.html
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not in the SCWCD exam, by the way.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your time and support
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marc Peabody:
That's not in the SCWCD exam, by the way.


LOL, thanks for information.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!