- This topic has 2 replies, 2 voices, and was last updated 20 years, 1 month ago by
mvbaffa.
-
AuthorPosts
-
mvbaffaMemberHi,
I am a newbie in Eclipse and have just bought the subscription and installed the product (SDK 3.0.2)
Sorry if this is two simple but the problems are so basic that I beleive that there was a problem in the installation procedure, even if no errors were reported.
I have created the HelloWorld demo. When I try to insert the following scriplet in the helloWorld.jsp page:
<%
HelloWorld hw = new HelloWorld();
out.println(hw.msg(“Marcus Baffa”));
%>The following errors were reported by the IDE:
1) When I have inserted the code “hw.” no assistant were shown with the HelloWorld methods. The methods shown were the ones associated with the JSP.
My HelloWorld class has the method “msg” as shown just below
public class HelloWorld {
public String msg(String s) {
return “Message=” + s;
}}
In the Scriptlet the “msg” method is underlined with a pink line and just beside this line Eclipse IDE shows a pink handle that states the following error:
– method msg(String) is undefined for the type HelloWorld
Well I cannot undertand, the method is defined and I have inserted a JSP import tag:
<%@ page language=”java” import=”com.mvb.pet.*” %>
com.mvb.pet is the package of HelloWorld class.
2) The other error is that when i have configured TOMCAT 5.0 I have selected the TOMCAT launch mode as Debug. But after the deployment, when I start Tomcat, the debug perpective is not activated.
Can someone help me.
Thanks in advance !!!
Riyad KallaMember1) I think this is most likely the bug we know about that when you have a class that has the same name as the JSP page, the editor get’s confused (HelloWorld.java and HelloWorld.jsp). So try and change the name of your pages to not match the class for now.
ALSO, you mentioned “pink underline” and right now I’m not aware of any default color of pink in the JSP editor, so make sureyou are opening your JSP page with the MyEclipse JSP Editor, close the page, right click on it > Open With > MyEclipse JSP Editor.
2) This will ve fixed in 4.0.
mvbaffaMemberThe problem was the name of the page and the class name. When I have changed the name to home.jsp everything worked.
About the pink underline, it was there. Just create a HelloWorld class and a helloWorld.jsp. When you write
<%
HelloWorld hw = new HelloWorld();
out.println(hw.msg(“Marcus Baffa”));
%>The portion “.msg” with be underlined with a pink line.
Thank you very much !!!!
-
AuthorPosts