Waw :)
Sometimes IDEA come to JSP compiled-by-fly feature? :) 

To execute TEI you must fill TagData, to do this, you must parse tag.
IDEA realy do this?

I have follow JSP code:
<stl:parameter name="param" />

<%
if (param == null || param.length() == 0) {
  ....
}
%>

The keyword 'param' write in red color, and IntelliJ say that variable
not defined. But it is clear, in tomcat its work fine.

The TEI class - look end of this message

in tld file:
        <tag>
                <name>parameter</name>
        
<tagclass>com.spklabs.basic.servlet.jsp.tagext.Parameter</tagclass>
        
<teiclass>com.spklabs.basic.servlet.jsp.tagext.ParameterTEI</teiclass>
                <bodycontent>empty</bodycontent>
                <info/>
                <attribute>
                        <name>id</name>
                        <required>false</required>
                        <rtexprvalue>false</rtexprvalue>
                </attribute>
                <attribute>
                        <name>name</name>
                        <required>true</required>
                        <rtexprvalue>true</rtexprvalue>
                </attribute>
                <attribute>
                        <name>request</name>
                        <required>false</required>
                        <rtexprvalue>true</rtexprvalue>
                </attribute>
                <attribute>
                        <name>session</name>
                        <required>false</required>
                        <rtexprvalue>true</rtexprvalue>
                </attribute>
                <attribute>
                        <name>default</name>
                        <required>false</required>
                        <rtexprvalue>true</rtexprvalue>
                </attribute>
        </tag>




In any case, thanks for very smart IDE.

-----Original Message-----
From: Mike Aizatsky [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, April 02, 2002 8:47 PM
To: [EMAIL PROTECTED]
Subject: RE: [Eap-list] Re.: webapp support


Alexey,

IDEA dynamically loads the TEI class and executes it to determine which
variables the tag defines.

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

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
On
> Behalf Of Alexey A. Efimov
> Sent: Tuesday, April 02, 2002 8:31 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [Eap-list] Re.: webapp support
> 
> Mike, are you sure that it's simple problem?
> For example:
> I have my custom tag - parameter, it read parameters from request,
then
> from session and them defaukt value. The tag wrtiten like this:
> 
> <stl:parameter name="submit" session="false" />
> 
> but this thanslated into my tag to follow full form:
> 
> <stl:parameter id="submit" name="submit" request="true"
session="false"
> />
> 
> id - is variable's name
> name - is a parameter name
> 
> So, the TEI have some logic, becose I can write: <stl:parameter 
> name="name" ... /> This make
> String name = request.getParameter("name");
> 
> And also I can:
> <stl:parameter id="myName" name="name" ... />
> It write:
> String myName = request.getParameter("name");
> 
> My TEI look like:
> /**
>  * TEI for Parameter tag
>  * @autor Alexey Efimov
>  */
> package com.spklabs.basic.servlet.jsp.tagext;
> 
> import javax.servlet.jsp.tagext.TagData;
> import javax.servlet.jsp.tagext.TagExtraInfo;
> import javax.servlet.jsp.tagext.VariableInfo;
> 
> public class ParameterTEI extends TagExtraInfo {
>   public ParameterTEI() {
>   }
> 
>   public VariableInfo[] getVariableInfo(TagData data) {
>     String name = data.getAttributeString("id");
>     if (name == null) name = data.getAttributeString("name");
>     return new VariableInfo[]{
>       new VariableInfo(name, "String", true, VariableInfo.AT_END)
>     };
>   }
> }
> 
> 
> So, very difficult translate it correctly. Maybe just decline this 
> option?
> 
> -----Original Message-----
> From: Hani Suleiman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 02, 2002 7:57 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Eap-list] Re.: webapp support
> 
> 
> I have the same problem, the TEI class in my case is located in the 
> WEB-INF/classes directory (rather than in a jar file in the lib dir,
as
> most other taglibs are)
> 
> On 2/4/02 10:36 am, "Mike Aizatsky" <[EMAIL PROTECTED]> wrote:
> 
> > Christian,
> >
> > Where is the TEI class located?
> >
> > Best regards,
> > Mike Aizatsky.
> > ------------------------------
> > JetBrains, Inc / IntelliJ Software
> > http://www.intellij.com
> > "Develop with pleasure!"
> >
> >> -----Original Message-----
> >> From: [EMAIL PROTECTED] 
> >> [mailto:[EMAIL PROTECTED]]
> > On
> >> Behalf Of Christian Sell
> >> Sent: Tuesday, April 02, 2002 7:23 PM
> >> To: [EMAIL PROTECTED]
> >> Subject: [Eap-list] Re.: webapp support
> >>
> >>>> also, IDEAS jsp support does not seem to recognize variables that
> > are
> >>>> introduced by tags. I have a tag which introduces a variable, and

> >>>> scripting which appears after the tag and makes use of the 
> >>>> variable. IDEA
> > shows
> >>>> errors, but the pages work flawlessly
> >>>
> >>>
> >>> It's also impossible to resolve the error having this amount of 
> >>> information. Do you have WebApp correctly defined? Is IDEA able to

> >>> autcomplete tags in your tag library? Do you have TEI classes for
> > your
> >>> tags?
> >>
> >> Here you go: My jsp looks roughly like below. The webapp is
correctly
> 
> >> defined and recognized, tag autocompletion works nicely. The trick
is
> > that
> >> the <runtime> tag introduces a scripting variable named "var" (as
> > defined
> >> by
> >> the parameter) into the current context (see the TEI class
definition
> 
> >> below). However, inside the <% %> script, IDEA does not recognize 
> >> that variable, and wrongly flags an error...
> >>
> >> JSP:
> >> ===
> >> <%@ taglib uri="www.dynabeans.com/wcf/taglibs/wcf01.tld"
prefix="wcf"
> > %>
> >>
> >> <p>blablabla</p>
> >> <wcf:runtime id="var" />
> >> <%
> >>     var.doSomething();
> >> %>
> >>
> >>
> >> TEI class:
> >> ======
> >> public final class RuntimeTEI extends TagExtraInfo
> >> {
> >>     /**
> >>      * Return information about the scripting variables to be
> created.
> >>      */
> >>     public VariableInfo[] getVariableInfo(TagData data)
> >>  {
> >>   String id = data.getId();
> >>   if(id != null) {
> >>    return new VariableInfo[] {
> >>     new VariableInfo(id,
> >>      "com.dynabeans.wcf.util.WCFRuntimeJ2EE",
> >>      true,
> >>      VariableInfo.AT_END)
> >>    };
> >>   } else
> >>    return new VariableInfo[0];
> >>     }
> >>  public boolean isValid(TagData data)
> >>  {
> >>   return data.getId() != null;
> >>  }
> >> }
> >>
> >>
> >> _______________________________________________
> >> 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
> 
> 
> _______________________________________________
> 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


_______________________________________________
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