In the *.tld,what's the use of the tag " variable "

For the jsp taglib technology.
In the *.tld file,accroding to the "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"
there is an optional tag "<variable>".
In some document , i saw an example as below:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>map</short-name>
<tag>
<variable>
<name-from-attribute>id</name-from-attribute>
<variable-class>java.util.Map</variable-class>
<scope>AT_BEGIN</scope>
</variable>
</tag>
</taglib>
What use of this?
Can anybody give me an simple example to explain this?
Thank u!

Thank u very much?
But i want to know, if I had set the <attribute> tag
as the example i had given.Do you mean attribute, or variable in the example you gave?
Here, I will give you a full example. This tag will set a new variable (given by an attribute name) a value provided by another attribute, and puts that variable into one of the four scopes (page, request, session, application)
You would use this tag like this:
<custom:setValue var="theVar" value="What I want" scope="page"/>
Where var = the name of the variable that will be exported
value = The value to assign to the variable
scope = the scope to put the variable into.
package tags;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.http.jsp.*;
import javax.servlet.http.jsp.tagext.*;
public class SetValueTag extends SimpleTagSupport
  private String varName, scope, value;
  public void setVar(String var) { varName = var; }
  public void setScope (String s) { scope = s; }
  public void setValue(String val) { value = val; }
  public void doTag() throws JspException, IOException
    PageContext context = (PageContext)getJspContext();
    if ("application".equals(scope)) context.setAttribute(varName, value, PageContext.APPLICATION_SCOPE);
    else if ("session".equals(scope)) context.setAttribute(varName, value, PageContext.SESSION_SCOPE);
    else if ("request".equals(scope)) context.setAttribute(varName, value, PageContext.REQUEST_SCOPE);
    else context.setAttribute(varName, value, PageContext.PAGE_SCOPE);
}The tag in your tld would look like this:
  <tag>
    <description>Set the value of a scoped variable</description>
    <name>setValue</name>
    <tag-class>tags.SetValueTag</tag-class>
    <body-content>empty</body-content>
    <attribute>
      <description>The name of the exported variable</description>
      <name>var</name>
      <required>true</required>
      <rtexprvalue>false</rtexprvalue>
      <type>java.lang.String</type>
    </attribute>
    <attribute>
      <description>The value to give the exported variable</description>
      <name>value</name>
      <required>true</required>
      <rtexprvalue>true</rtexprvalue>
      <type>java.lang.String</type>
    </attribute>
    <attribute>
      <description>The the scope of the exported variable</description>
      <name>scope</name>
      <required>false</required>
      <rtexprvalue>false</rtexprvalue>
      <type>java.lang.String</type>
    </attribute>
    <variable>
      <name-from-attribute>var</name-from-attribute>
      <variable-class>java.lang.String</variable-class>
      <scope>AT_BEGIN</scope>
      <declare>true</declare>
    </variable>
  </tag>>
Then what should i do in the TagHandler programme(A
javabean handle the tag)?
And what should i do in the JSP page ?
Can u give me an simple example?

Similar Messages

  • HT204149 What is the maximum resolution available for use with the Apple Mini DisplayPort to Dual-Link DVI adapter?

    What is the maximum resolution available for use with the Apple Mini DisplayPort to Dual-Link DVI adapter?

    Hey guys,
    I found out an answer by myself...
    The missing link : the MacBook Pro needs to be powered... as in you need to plug the charger in...
    In conclusion, you simply plug everything, turn on the MacBook Pro, close the lid, and there you go !

  • What font is used in the "video title text" in Adobe Presenter Video Creator? I need to replicate it

    What font is used in the "video title text" in Adobe Presenter Video Creator? I need to replicate it.

    I just noticed, Hah! That it is the same font as used in the text on this page. Anyone know what it is?

  • FAQ: What font is used by the London Underground (London Transport)

    This summer, while on vacation in the UK, I spent a few hours in the London Transport Museum. Surprisingly enough, in their gift shop, two items for sale attracted my attention. One was a book and the other, a collection of fonts!
    Every so often, the question comes up on this forum and others as to exactly what font is used in the London Underground. The book in question,
    Johnston's Underground Type by Justin Howes definitively answers that question and provides quite a bit of background on the subject.
    To summarize, the basis of the font used today is
    Johnston Sans, dating back to 1916. Johnston Sans also had an upper case-only bold face. These two faces were used with various modifications until 1988 when the font was modernized with the release of
    New Johnston, a family of nine typefaces based upon Johnston Sans. The family includes light, light italic, medium, medium italic, medium condensed, bold, bold italic, bold condensed, and stencil weights / styles. New Johnston Medium most closely resembles the original Johnston Sans face in terms of weight and style.
    Neither the original Johnston Sans nor the current New Johnston are licensed by London Transport for any external use.
    However, at the London Transport Museum (and I believe on-line from the P22 Type Foundry), you can purchase a license and media for P22's rendition of Johnston Sans including three faces - P22 Underground, P22 Underground Bold (uppercase only), and P22 Underground Extras (symbols associated with London Transport over the years). Included on the CDROM are both Type 1 and TrueType versions of the typefaces in both Windows and Macintosh formats. The designs were officially licensed from London Transport. The EULA (End User License Agreement) carries some
    very strict restrictions with regards to embedding in PDF or any other file type as well as commercial use of any printed output formatted with these typefaces.
    A fairly close (and less restrictively-licensed alternative) to the P22 package or for Johnston Sans and New Johnston (neither of which are available for license) is ITC Johnston, available in Type 1 and TrueType versions in both Windows and Macintosh formats. Fifteen individual typefaces are available including old style figures and small caps, italic styles, as well as light, medium, and bold weights. Alas, they are not (yet) available in OpenType format.
    In any case, further information and background is available in
    Johnston's Underground Type by Justin Howes.
    - Dov

    RedHavoc wrote:
    I'd like to hear the rest of this. Were you there yourself?
    I was. I have to say as much as there is a lot of negativity towards Larry Jordan, I really respect him for not shying away from adversity and talking about the issues quite Frankly. I mean, his talk was laced with quite a lot of rhetoric ("it's not the end of the world", etc etc), but he didn't decline to answer any questions (including my own: "what were they thinking").
    RedHavoc wrote:
    Having spent the past three days on this forum, I think that list only covers about half of the gripes people have and the problems people are facing!
    These are just the things I remember off the top of my head. Sadly I didn't make any notes, in all honesty because I was expecting the whole thing to be a whitewash. Remind me of anything I've left out and I'll try to cover it.
    I'll try to transcribe the recording today as it was the only thing that's come close to an official word on the situation from Apple, though I have to say the recording is not particularly good :/

  • What font is used for the menu of Illustrator CS5?

    What font is used for the menu of Illustrator CS5?
    I know how to change the default font, which is used to input characters.
    But, I do not know how to check the font used in the menu.
    Is it the font that is described in the following files?
    C:\Users\[UserName]\AppData\Roaming\Adobe\Adobe Illustrator CS5 Settings\ja_JP\AIPrefs
    If you know, please tell me how to check the configuration file and how to change the font that is used in the menu.

    If your using windows xp and applied the 12.02 update, then this is a known bug in
    the update effecting xp users and adobe is working on a fix.
    see this thread
    http://forums.adobe.com/thread/762392?tstart=30
    MTSTUNER

  • What app is used in the new commercial to show cells undergoing mitosis?

    What app is used in the new commercial to show cells undergoing mitosis?  I teach Biology and would love to find this one!

    I was going by this page - http://www.macrumors.com/2013/02/17/apple-posts-new-alive-ipad-television-ad/
    And I found these on Vimeo's web site
    http://vimeo.com/53812680
    http://vimeo.com/15357750
    And they have a bunch more, just search for mitosis on their web site.

  • I am wondering what tools were used in the "Body Evolution" video

    Hi,
    I am wondering what the names of the tools that were used in the "Body Evolution" video? I know somw of them, but I don't know what tools they used for the eyes, nose and to stretch the legs.
    Thank you!

    Station Two,
    I am not in the habbit of, nor do I ever plan to be in the habbit of, photoshopping things to death for the pupose of making it "picture perfect."
    I have always been a person that loves to know how. I may never use it, I just like to know how. Take a look at my work:
    https://www.facebook.com/BenjaminRootPhotography
    I definitely know it wasn't meant to be a tutorial, and personally, I think it's sick when someone photoshops a person like that.
    Like I said before, it all just looked different to me and I wondered what they used.
    I mainly use Photoshop to correct lighting, or to put someone on a different background, or to add a little color to something, or corect some minor things that they request; but a bove all, I alway try to make it look realistic and like the person.

  • What accessories were used in the iphone video recorded in January 2014

    I am trying to learn what "extras" were used in the making of the Apple video of 24 January 2014.  Credits indicate extra accessories were used.  I would like to learn what they were.

    The Apple posted 30th Anniversary video is less than 30 days old!  So, "in the past" leads me to believe you are out of touch with reality!  
    In the Apple posted video discussion of how the video was made, there are clips of the iphones used with their accessories.  I was hoping others here would be able to recognize the accessories and share their wisdom. 
    PLEASE forgive me if I have over stepped the boundaries you are imposing on this group.  I am seeking help not reprimands!

  • What font is used for the tool flyout labels.

    What font is used for the tool flyout labels, mine are blank, however they work fine for the Menu items. Thank you, [email protected]

    If your using windows xp and applied the 12.02 update, then this is a known bug in
    the update effecting xp users and adobe is working on a fix.
    see this thread
    http://forums.adobe.com/thread/762392?tstart=30
    MTSTUNER

  • What font is used in the Lion sidebar

    Hello there...
    Does anyone know what font is used in the Lion Sidebar?
    You can see it all over the OS for example, it's also used in Mail to show all the folders and Mailboxes...
    I know how to adjust the size, I just want to know the name of the Font.
    My guesses are Calibri or Lucida Grande but I'm not sure.
    Thank you

    Hello David,
    Unfortunately it is definately not Helvetica. You can see differences in the letter shapes. It's particularly noticable in "e" and "a" characters...
    Pasting into TextEdit will simply inherit the font used in the document, which for a new TexEdit file is Helvetica Regular.
    Anyone else have any thoughts?

  • What Font is used as the default LabView System and Dialog Font on a windows?

    What font is used as the default LabView System and Dialog font on a Windows system?
    Can I use the default system and dialog font in another software (i.e; Win word or Illustrator etc.)

    For Windows XP, the font is Tahoma. I don't know if Windows has a method for changing this (I thought it would be in the display settings, but couldn't find it). Maybe in the registry?
    For more details, see here.
    Try to take over the world!

  • I am getting a message - the iphone can not be used because the apple mobile devise service is not started - what does this mean - what do i need to do?

    i am getting a message - the iphone can not be used because the apple mobile devise service is not started - what does this mean - what do i need to do?

    See Here...   http://support.apple.com/kb/TS1567

  • HT204406 The song "If We Are the Body" could not be used because the original file could not be found. Would you like to locate it?  This notice keeps coming up even though I have iTunes Match.  What do I do?

    The song “If We Are the Body” could not be used because the original file could not be found. Would you like to locate it?  This notice keeps coming up even though I have iTunes Match.  What do I do?

    This usually means the original music file has been been deleted from the HDD. If you feel it has not then click "locate" and navigate to where the song file is on the HDD and choose it. You can use Spotlight to locate it if necessary.

  • Is there a way to visually see what clips are used in the timeline?

    In FCP, is there a way to see in the browser all the clips that are being used in the timeline?
    What I am looking for is a column that has a check mark in it if the clip is being used in the timeline.
    In a big project, it would be good to visually see what clips have yet to be used.
    Just wondering.
    Ian

    This probably isn't exactly what you're looking for, but you can turn on show duplicate frames in your timeline.
    There is an option in the sequence>timeline settings that when turned on will put a red line under any footage that is duplicated in your sequence.
    However there must be a reel number assigned to the clip and the timecode must be unique in order for it to work properly.
    Another work around might be to color code each clip as you use it in your browser.

  • What are tools used by the xi/pi system ,to bug the errrors

    hi gurus,
    what are tools used by the xi/pi system ,to bug the errrors.
    regards,
    subba reddy

    For all kind of errors the only tool available which bugs or say alerts for the error is Alert Management.
    Alerts are messages which can be raised in case of failure.
    Alerts - used for system errors, u can send a mail or msg whenever there is any failure. alert configuration can be done in t-code - ALERTCATDEF.
    Alert Categrory can be defined in transaction ALRTCATDEF on abap stack. we can assign receipients to every alert category which specifies who will receive alert in case of error.
    Alert rules can be defined in RWB.
    for configuring alerts u need follwing roles first for defining or creating alertcategory
    the roles reuired to access the RWB are:
    1. SAP_XI_RWB_SERV_USER
    2. SAP_XI_RWB_SERV_USER_MAIN
    The roles for the Alert Management are:
    1. SAP_ALM_ADMINISTRATOR
    2. SAP_ALM_CUSTOMIZER
    3. SAP_BC_ALM_ALERT_USER
    Once this is done
    alert category is defined and then tested
    For Alert please see
    The specified item was not found.
    http://help.sap.com/saphelp_nw04/helpdata/en/56/d5b54020c6792ae10000000a155106/content.htm
    For details follow this link,
    http://help.sap.com/saphelp_nw70/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm

  • Since i download the new version of i tunes i canot play the songs of my library...it say that "the song could not be used because the original file could not be found" what i do to just play the songs directly? please someone help

    since i download the new version of i tunes i canot play the songs of my library....it say "the song could not be used because the original file could not be found".
    would you like to locate it.i just want to play directly..what i do?  please help  thanks

    This happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

Maybe you are looking for

  • Sales Rep lied to me. what do I do?

    I'm 18 years old. A few weeks ago I broke my Galaxy s3. I do have insurance on it, but I figured I might as well go to my local Verizon store to see if they have any promotions. Long story short, I told the sales rep that I wanted the Galaxy s5. All

  • "Dynamic column" in the workplace

    Hi experts. Do somebody know the possible uses of the "Dynamic column" field in the task registers of the Workflow inbox? You can add some dynamic columns via the "select layout" menu of the workplace but they seem to be empty. I'm wondering if I can

  • Acrobat X page shows small page image at top right of screen. Need to remove

    Acrobat X on Windows 8.1.  Recently Acrobat has started showing a small representation of the current page at the top right of the screen. I don't need this and would like to kill it permanently in all files. For example apart from blocking some text

  • Some of my movies I had on my iPod deleted and I can't get them back?

    I had The Hunger Games, Breaking Dawn Part 2, and The Perks of Being a Wallflower on my iPod. They were a free digital copy download from when I bought the movies. I backed up my iPod after putting them on, but today I plugged my iPod into my compute

  • Load data from file extremely slow due to refresh

    Hi I am loading a data from a csv file to an existing table in a PeopleSoft schema on Oracle 11G. The process works fine except that it takes an extremely long time. I suspect that this is because SQL Developer is refreshing the table list on the lef