I want to be able to create a variable in a custom tag and make this
variable available in the JSP the tag was called from.
To do this I added the following line to the doStartTag (or doEndTag) method
in the custom tag.
pageContext.setAttribute("myvariable", myvariable,
PageContext.APPLICATION_SCOPE);
I then created a TagExtraInfo class that looked similar to the following
(this class was added to the tld file):
public class myTEI extends TagExtraInfo
{
public VariableInfo[] getVariableInfo(TagData data)
{
String name = data.getAttributeString("name");
String type = data.getAttributeString("type);
VariableInfo[] scriptvars = new VariableInfo[1];
scriptvars[0] = new
VariableInfo(name,type,true,VariableInfo.AT_BEGIN);
return scriptvars;
}
}
The problem with this is that in getVariableInfo the values of name and
type are null.
Can anyone tell me if the problem is with the line of code where I add the
variable to the pageContext or with the TEI class and how I can fix this?
Thanks,
Catharine
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets