facebook

jspf: Code completion [Enhancement]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #202162 Reply

    sfl
    Member

    Hello,

    i´m using Eclipse 2.1.2 with MyEclipse 2.7 RC2 on Windows XP.
    I have little problem with .jspf files

    My Jsp File looks like:
    <%@ page language=”java”%>
    <%@ page import=”java.util.*” %>
    <body>
    <%@ include file=”/jspf/source.jspf” %>
    </body>

    My source.jspf:
    <%
    Date date = new Date();
    out.println(date.getTime());
    %>

    The problem is the import of java.util.* in the jsp file. So he didn´t know that in the jspf. But when i import it there too, he produces a warning.

    The same is with variables, when the declaration is in the jsp and the usage in jspf. Than a declaration in jspf produces an dupplicate declared error.
    The error didn´t surprise, because it is duplicate. But how can i tell him that the declaration or import is in the main JSP (or an other jspf). When he didn´t knows that he can´t complete the function date.get… or the variable.function…. .

    Any Idea ???

    #202185 Reply

    support-michael
    Keymaster

    I understand. As you have identified the JSP fragment doesn’t know its environment. I have kicked an idea to development to allow association of a containing JSP for code completion support. I have no idea if they’ll buy it but they love innovative ideas (not sure if this qualifies).

    Michael
    MyEclipse Support

    #202200 Reply

    No Operation
    Member

    Since the idea of included JSP fragments (jspf) is, to be included from many JSP pages, it is impossible to determine, which JSP page should be used to associate with.

    But a general rule might help (one of my plenty rules):

    If cannot extract an atomar code fragment, dont extract it.

    In terms of your problem:

    The imports must only exits in the JSP fragment. If this is not possible, dont use a JSP fragment for the code which needs that import.
    The variable declarations must exist in the JSP fragment. If this is not possible, dont use a JSP fragment for the code that needs that declaration.

    hope this helps a bit

    NOP

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: jspf: Code completion [Enhancement]

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