facebook

JSP Code Completion does not work with Custom Tags

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #261492 Reply

    mavesbs
    Member

    Hi,

    I have a clean Eclipse 3.2.1 and a clean MyEclipse Enterprise Workbench Version: 5.0.1 GA Build id: 20060810-5.0.1-GA install.
    In my JSPs I often use custom tags which allow you to define a variable which is only valid within the tag.

    For example:

    <%@ taglib uri="http://test.test/test" prefix="tag"%>
    <html>
    <body>
    bla
    <tag:test name="blabla"> Test<br><%= helloWorld %><br><%= blabla %></tag:test>
    test
    </body>
    </html>
    

    The tag “test” defines a variable “helloWorld” and a dynamic variable “blabla”. Dynamic because you can define the name of the Variable with the attribute. Now, code completion works fine with “helloWorld”, but it does not work with “blabla”.

    Some code from the tag class:

    
        public int doStartTag() throws JspException
        {
            pageContext.setAttribute("_varname", getName(), PageContext.REQUEST_SCOPE);
            pageContext.setAttribute(getName(), "Hello World", PageContext.REQUEST_SCOPE);
            pageContext.setAttribute("helloWorld", "Hello World Org", PageContext.REQUEST_SCOPE);
            return EVAL_BODY_INCLUDE;
        }
    

    Code from the TagExtraInfo class:

    public VariableInfo[] getVariableInfo(TagData data)
        {
            return new VariableInfo[] {
                    new VariableInfo(data.getAttributeString("_varname"), "java.lang.String", true, VariableInfo.NESTED),
                    new VariableInfo("helloWorld", "java.lang.String", true, VariableInfo.NESTED)};
        }
    

    I have a small example which demonstrates this problem and would be happy to mail it.

    Thx, Adrian.

    #261500 Reply

    Riyad Kalla
    Member

    Adrian,
    We are sorry you are running into this. The problem is that the JSP editor currently doesn’t understand *what* tags do, a little more detail is outlined here:
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-13364.html

    We hope to have a solution in place for this in a future release.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: JSP Code Completion does not work with Custom Tags

You must be logged in to post in the forum log in