- This topic has 2 replies, 3 voices, and was last updated 21 years ago by No Operation.
-
AuthorPosts
-
sflMemberHello,
i´m using Eclipse 2.1.2 with MyEclipse 2.7 RC2 on Windows XP.
I have little problem with .jspf filesMy 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 ???
support-michaelKeymasterI 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
No OperationMemberSince 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
-
AuthorPosts