- This topic has 6 replies, 5 voices, and was last updated 20 years, 4 months ago by support-michael.
-
AuthorPosts
-
tbrantbMemberI have a jsp file. The first 2 lines of the jsp file are uneccesary imports.
Sometimes I get these as warnings. Sometimes i don’t. Usuaully I get the warning if there is some other error on the page, but not always. Any clues why it doesn’t always show me this warning.Also, shoul I have to save the file before errors/warnings go away. I have to on JSP files, but I do not have to on java files.
Thanks
Scott AndersonParticipantI have a jsp file. The first 2 lines of the jsp file are uneccesary imports. Sometimes I get these as warnings. Sometimes i don’t.
That’s interesting. Can you replicate a small test case and a set of steps that always show the behavior?
Also, shoul I have to save the file before errors/warnings go away.
Yes, you have to save the file. This is because the JSP compiler must be invoked to determine what the errors are and it is automatically run with the file is saved. The Java compiler and editor work a little differently. The Java editor does a realtime syntax analysis while you type and then can perform incremental compilation on save.
One other thing to watch out for is that if you change Java code upon which JSP’s depend, right now the JSP’s are not automatically recompiled. We’ll be updating our file dependency model in a subsequent release, but right now it’s safest to right-click on the project and select ‘Recompile All JSP’s’ as a final check before deployment if you’ve been doing any heavy modifications.
–Scott
MyEclipse Support
tbrantbMemberHere is a jsp:
<%@ page language=”java”%>
<%@ page import = “java.util.*” %><html>
<head>
<title>title</title>
</head><body>
<%=”Hello World”%>
</body>
</html>Notice the java.util.* is unused.
I do not get the warning that jata.util.* is unused unless some other error arises on the page.
For instance:
<%@ page language=”java”%>
<%@ page import = “java.util.*” %><html>
<head>
<title>title</title>
</head><body>
<%=”Hello World”%>
<%=foo%>
</body>
</html>foo is never defined, so I get the error “foo cannot be resolved” (As expected) and the warning “The import java.util is never used”. (As expected)
Just stuck me as odd that I only get the warning if there is some other error in the code.
support-michaelKeymasterThanks for the report and example code. I can not think of a 1st principal explanation for this behavior. I have entered your report into our issues tracking system for further research. We’ll keep you posted on what we find out.
Regards,
Michael
MyEclipse Support
No OperationMemberif there are errors, you notice an additional message in the progress monitor – something with … AST …
Perhaps coincidence with those warnings?
NOP
Olov_FeltonMemberDid you ever find a solution to this problem, warnings only showing up in jsp when there are errors? I am wondering as I have this exact problem with Eclipse 3.0 and MyEclipse 3.8 Beta-1. And it gets booring to always have to add something like foo = bar; to see the warnings…
/Olov
support-michaelKeymasterI just confirmed that the fix for this problem is already in the beta-2 codestream and will be available in the next release.
-
AuthorPosts