Mike,

I have spent some time looking why Ariadna recognizes scripting variables in
Apache request.tld, but completely ignores them in my custom tld.

I found a surprising restriction:

Apache request tld was used as follows:

<%@ taglib uri="http://jakarta.apache.org/taglibs/request-1.0"; prefix="req"
%>
<req:request id="myReqVar" />

Starting at this point, "myReqVar" is correctly recognized as scripting
variable with type obtained from TEI class.

However, this works only if specified as
<prefix:tagName id="varName" />
I.e. variable can be declared only by specifying its name as attribute value
in tag, even more, the attribute itself should be named "id". It seems that
taglib processing in Ariadna pays special attention to attribute named "id".

Ariadna fails to recognize scripting variable declarations from the
following tags:
<prefix:tagName name="varName" />
<prefix:tagName key="TEIdeclaresOtherNameInternally" />

In my custom taglibs I declare up to 10 variables for a single tag, none of
them is declared through "id" attribute. Scripting variable names are
predefined within TEI:

public class EntryTEI extends TagExtraInfo {
 public final VariableInfo[] getVariableInfo(TagData data) {
  VariableInfo[] vars = new VariableInfo[9];

  vars[0] =  new VariableInfo("returnMap", "java.util.Map", true,
VariableInfo.AT_BEGIN);
  vars[1] =  new VariableInfo("sessId", "java.lang.String", true,
VariableInfo.AT_BEGIN);
  vars[2] =  new VariableInfo("lang", "java.lang.String", true,
VariableInfo.AT_BEGIN);
  vars[3] =  new VariableInfo("pageElement", "org.jdom.Element", true,
VariableInfo.AT_BEGIN);
  vars[4] =  new VariableInfo("error", "java.lang.String", true,
VariableInfo.AT_BEGIN);
  vars[5] =  new VariableInfo("param", "java.util.Map", true,
VariableInfo.AT_BEGIN);
  vars[6] =  new VariableInfo("multiParam", "java.util.Map", true,
VariableInfo.AT_BEGIN);
  vars[7] =  new VariableInfo("rc", "java.lang.Integer", true,
VariableInfo.AT_BEGIN);
  vars[8] =  new VariableInfo("serviceElement", "org.jdom.Element", true,
VariableInfo.AT_BEGIN);
  return vars;
 }
}

I expect the following JSP to work:

<%@ taglib uri="/mytaglib" prefix="mytaglib" %>
<mytaglib:Entry name="Hello" sort="yes" />
count: <%= pageElement.getAttributeValue("count") %><br />
session Id: <%= sessId %><br />
error message: <%= error %>

Finally, if TLD declares attribute other than "id", but tag in JSP still
refers to "id" (which is not declared), then Ariadna displays "Internal
Error" with the following trace:

[1451857]  ERROR - intellij.plugins.PluginManager - IntelliJ IDEA 3.0  Build
#618
[1451857]  ERROR - intellij.plugins.PluginManager - JDK: 1.3.1_02
[1451857]  ERROR - intellij.plugins.PluginManager - VM: Java HotSpot(TM)
ClientVM
[1451857]  ERROR - intellij.plugins.PluginManager - Vendor: Sun Microsystems
Inc.
[1451857]  ERROR - intellij.plugins.PluginManager - OS: Windows 2000
[1451857]  ERROR - intellij.plugins.PluginManager -
java.lang.NullPointerException
        at com.intellij.psi.impl.source.e.a.c.<init>(c.java:15)
        at com.intellij.psi.impl.source.e.a.d.a(d.java:20)
        at com.intellij.psi.impl.source.e.a.d.a(d.java:55)
        at com.intellij.codeInsight.daemon.impl.ci.b(ci.java:65)
        at com.intellij.codeInsight.daemon.impl.ci.a(ci.java:89)
        at com.intellij.codeInsight.daemon.impl.ci.a(ci.java:25)
        at com.intellij.psi.impl.source.e.d.a(d.java:22)
        at com.intellij.codeInsight.daemon.impl.cg.a(cg.java:202)
        at com.intellij.psi.ba.a(ba.java:116)
        at com.intellij.psi.impl.source.e.d.a(d.java:22)
        at com.intellij.codeInsight.daemon.impl.h.a(h.java:32)
        at com.intellij.codeInsight.daemon.impl.h.run(h.java:121)
        at com.intellij.openapi.c.a.b.a(b.java:226)
        at com.intellij.codeInsight.daemon.impl.cl.b(cl.java:18)
        at com.intellij.codeInsight.daemon.impl.cl.a(cl.java:31)
        at com.intellij.codeInsight.daemon.impl.cl.a(cl.java:33)
        at com.intellij.codeInsight.daemon.impl.bu.run(bu.java:1)
        at com.intellij.progress.ProgressManager.a(ProgressManager.java:10)
        at com.intellij.codeInsight.daemon.impl.cl.run(cl.java:55)

Best regards
--
Edmundas


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Mike Aizatsky
Sent: Friday, April 19, 2002 5:29 PM
To: [EMAIL PROTECTED]
Subject: [Eap-list] TEI


Hi,

Is TEI support working in build #618 at last?

Best regards,
Mike Aizatsky.
------------------------------
JetBrains, Inc / IntelliJ Software
http://www.intellij.com
"Develop with pleasure!"



_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to