- This topic has 7 replies, 3 voices, and was last updated 20 years ago by Riyad Kalla.
-
AuthorPosts
-
johnMemberThis is a minor issue with the MyEclipse JSP Editor in
Version: 3.8.2
Build id: 200409171200-3.8.2.
(I’m fairly certain that’s the GA release.)[File/class names changed to protect the innocent.]
I have a file named JohnDoe.jsp, which imports a class called org.example.fake.JohnDoe. The JSP editor complains about the import, saying ‘The import org.example.fake.blah.JohnDoe conflicts with a type defined in the same file (in file: “org.example.fake.blah.JohnDoe”)’.
I’m pretty sure this import should be allowed by the JSP spec. (I know it’s supported by both Tomcat and Weblogic, as both servers name the generated jsp servlets something a little funny. I think Weblogic does “_JohnDoe.class” and Tomcat does “JohnDoe_jsp.class.”)
When I copy the contents of JohnDoe.jsp into Temp.jsp, the Editor likes the import just fine.
-john.
Riyad KallaMemberJohn,
We use the Jasper2 JSP compiler that is from the Tomcat project to validate/compile JSP pages, so the errors should be on par. Besides that, having two files name exactly the same thing will confuse the snot out of the source lookup mechanism in the debugger, so maybe its a good idea not to do that 😉
Paul KaiserMemberAren’t the JSP-derived classes in a different namespace?
johnMemberRiyad,
I don’t know what you use to compile JSP pages, but I just tested this scenario with both Tomcat 4.1.31 and Tomcat 5.0.30, and in both versions a JSP can import and use a class whose unqualifed name is the same as the name of the JSP file (minus the .jsp extension).The output from my test page (SameName.jsp) looks something like this:
I am a org.apache.jsp.SameName_jsp, specifically org.apache.jsp.SameName_jsp@1ea0105.
I used a somepackage.SameName, specifically somepackage.SameName@1e91a4d.For what it’s worth, I agree that naming JSP pages and classes the same thing is not a great idea, but that’s really beside the point.
Thanks.
-john.
johnMemberI see that my bug is a natural consequence of the cause of this issue (marked FIXED in 3.8.3, although my bug still exists):
ID: 968, Jasper Validation and JSP Editor Reconciliation Validation are Different
Even though MyEclipse compiles with Jasper (hence SameName.jsp does not show a red X decorator on its icon), the editor realtime-compiles with code that’s part of IBM’s Webtools contribution, which applies different rules and does not handle this name conflict.
In addition to the error marker at the import line, all method invocations (unless the methods happen to match signatures of methods defined in the JSP) are also marked as errors. Of course Ctrl-Click also doesn’t navigate, since the editor is not resolving the class correctly.
Is there any plan to address this? Thanks.
-john.
Riyad KallaMemberJohn,
We are spread pretty thin right now working on 3.9 (already! No down time around here), could you do us a huge favor and create a small Web Project that exhibits this problem, export it to a ZIP and email it to [email protected] ATTN Riyad? I’ll test it and file the bug with the project attached so we have a real-world test case to run with when we fix the bug.
johnMemberSent. Thanks.
Riyad KallaMemberGot it and filed it, thanks for your help John.
-
AuthorPosts