- This topic has 10 replies, 2 voices, and was last updated 21 years, 2 months ago by
Scott Anderson.
-
AuthorPosts
-
Gerald HokampMemberHello all,
I’m rather new MyEclipse. I have setup my project as described in the tutorial. Everything works fine, but for nearly every page I get an error message.
One of this message is:
>>Syntax error on keyword “public”; “Identifier” expected<<And the first three lines of the JSP page are
<%@ page language=”java” %>
<%@ taglib uri=”/WEB-INF/struts-bean.tld” prefix=”bean” %>
<%@ taglib uri=”/WEB-INF/struts-html.tld” prefix=”html” %>Maybe I’m a bit stupid but what could cause these error messages?
I use the Eclipse SDK-M1 (it happens also in the 2.1. release) , MyEclipse EA1 and the Struts-Framework.Any help is appreciated.
Thank you
Gerald
Scott AndersonParticipantGerald,
I’m sorry, but you didn’t provide us with enough context information to answer your question. The error has to do with the use of the public keyword, but you haven’t shown us any uses of it or mentioned which line this error is occurring on, or whether this is in scriptlet code or the JSP markup itself. If you could give us some more information we’ll do our best to assist you.
One other note: we do not certify MyEclipse on any builds but Release builds. Use of MyEclipse on the new 2.1.1 M1 build is not recommended.
Gerald HokampMemberHello Scott,
Thanks for your reply.
Well, I’ll try to specify my problem.I recreated my already existing web application so that I could use it with MyEclipse (I followed the instructions). After that I did a “rebuild project”. When I checked the error messages I saw a lot of problems in my JSPs. One message which I could not understand was
>>Syntax error on keyword “public”; “Identifier” expected<<The error message is shown in the first line of the JSP, which is:
<%@ page language=”java” %>I think the problem has to do with the compiled JSP.
I asked here because I have no idea what’s happening. I hoped that it was a well known problem … 🙂
Gerald
P.S.: I will switch back to the 2.1 release …
Scott AndersonParticipantGerald,
Two ideas initially come to mind that can help us run this down. First, please create a sample JSP page using the MyEclipse wizards by first selecting your web root directory in the package explorer and then selecting File->New->Other->J2EE->JSP. When you get to the second page of the wizard, please UNCHECK ‘Generate/Map web.xml file’ before selecting finish. This new JSP should now be in the top level of your web root directory. Did it compile correctly? If so, the compilation problem is caused by something within your JSP file. If not, let’s proceed to the next idea.
There is a known problem with renaming the web root directory after project creation within version 2.0.3 EA1 of the workbench. Did you rename the root? Please right-click on the project and select ‘Properties->MyEclipse’ does the web root directory listed in the dialog agree with the root you’re using for your web project? If not, please reselect the web root directory and hit save.
Please let me know what you determine.
–Scott
MyEclipse Support
Gerald HokampMemberHello Scott,
I tried your first idea and … it worked.
Many thanks for the hint.So I think I have to look for the problem inside the JSP 🙂
BTW is it possible to see the Java-servlet code which is generated when the JSP is compiled? There seems to be a temporary file in the folder .myeclipse but it vanishes after the compilation. Is it possible to make it permanent?
Gerald
Scott AndersonParticipantGerald,
Glad I got you heading down a path to find the problem. At least you know your project setup is correct.
BTW is it possible to see the Java-servlet code which is generated when the JSP is compiled?
Not really. Our goal is to allow developers to ignore the generated code since we map any errors back to the corresponding line in the JSP.
To help find out what’s going on, how about cutting down your JSP to the smallest size that still exhibits the error and posting it here so that others can give it a look and maybe give you some help?
–Scott
MyEclipse Support
Gerald HokampMemberScott,
I have found the problem but I can’t believe it …
In my webapp I have directory /jsp. Under this there are two more directories called public and admin.
So we have /jsp/public and /jsp/admin. Under /jsp/admin everything compiles fine (only the errors that I wanted to know). Under /jsp/public I always got the “Syntax error on keyword “public”; “Identifier” expected” error.
I renamed the /jsp/public directory to /jsp/application and now everything worked fine. Now I understand where the ‘public’ keyword comes from, but I can’t understand why I can’t use ‘public’ for the name of the directory.
Are there any restrictions I don’t know?Regards
Gerald
Scott AndersonParticipantGerald,
Wow, that’s a weird one. I’ve been able to replicate the problem your seeing by following your instructions. I’ve entered this issue into our internal defect tracking system so that it can be addressed in the next release.
Are there any restrictions I don’t know?
None that are intentional. 🙂
–Scott
MyEclipse Support
Gerald HokampMemberHello Scott,
Once again thanks for your kind support.
Now that’s a bug and not a feature, I will ignore the error in the meantime and wait for the fix.
Gerald
Scott AndersonParticipantGerald,
And thank you for taking the time to determine what the problem was and letting us know about it. By doing that, you’ve made the product better for everyone.
–Scott
MyEclipse Support
Scott AndersonParticipantThe problems identified in this thread were address in MyEclipse v2.1.1 EA2.
–Scott
-
AuthorPosts