This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Please note that I have done you the favor of removing the "URGENT" from your topic title. Be advised that most people here would regard that as rude and ignore your question. (And be honest, was your post really that urgent?)
In order to make best use of the resources here on the Ranch, I would advise you to not use phrases like "urgent" in your posts. The best way to make sure that your questions will get clear and helpful answers is to post clearly worded and thoughtfully asked questions.
Now on to your question: what exactly do you mean by "custom tag result"?
Am I correct to assume that you wish to populate or create a scripting variable from your tag(s)?
Joined: Aug 14, 2003
First, Sorry if I am not following your conventions of posting questions. But truly speaking, I am really looking for some help on this ASAP.
Let me explain my question clearly. I have a custom tag that gives a number(can be 0, +ve, or -ve). Now, I want to display a different text in the jsp page for different numbers that I obtain from the custom tag. How shoud i proceed?
Yes, it's just a lot easier if you were already using JSTL.
Here's one way:
1) In your tag create a scripting variable and assign it the appropriate value. You can create the variable either via the "variable" declaration in the tag TLD, or with a TEI class. See a Custom Tag tutorial for specifics.
2) Be sure to specify that the scope of the variable is after the tag.
3) In your page use an if then else if then construct to switch between the various options based upon the value of the variable.