MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
gdhokamp
Post subject: Error messages in JSP  PostPosted: Jun 12, 2003 - 10:28 AM
Registered Member
Registered Member


Joined: Jun 06, 2003
Posts: 6

Hello 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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-scott
Post subject:   PostPosted: Jun 12, 2003 - 04:43 PM
Moderator
Moderator


Joined: May 06, 2003
Posts: 6760

Gerald,

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.

_________________
--Scott
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
gdhokamp
Post subject:   PostPosted: Jun 13, 2003 - 07:06 AM
Registered Member
Registered Member


Joined: Jun 06, 2003
Posts: 6

Hello 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 ...
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-scott
Post subject:   PostPosted: Jun 13, 2003 - 01:52 PM
Moderator
Moderator


Joined: May 06, 2003
Posts: 6760

Gerald,

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

_________________
--Scott
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
gdhokamp
Post subject:   PostPosted: Jun 14, 2003 - 01:07 PM
Registered Member
Registered Member


Joined: Jun 06, 2003
Posts: 6

Hello 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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-scott
Post subject:   PostPosted: Jun 14, 2003 - 05:03 PM
Moderator
Moderator


Joined: May 06, 2003
Posts: 6760

Gerald,

Glad I got you heading down a path to find the problem. At least you know your project setup is correct.

Quote:

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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
gdhokamp
Post subject:   PostPosted: Jun 17, 2003 - 01:01 PM
Registered Member
Registered Member


Joined: Jun 06, 2003
Posts: 6

Scott,

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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-scott
Post subject:   PostPosted: Jun 17, 2003 - 02:50 PM
Moderator
Moderator


Joined: May 06, 2003
Posts: 6760

Gerald,

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.

Quote:

Are there any restrictions I don't know?

None that are intentional. :-)

--Scott
MyEclipse Support

_________________
--Scott
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
gdhokamp
Post subject:   PostPosted: Jun 17, 2003 - 03:46 PM
Registered Member
Registered Member


Joined: Jun 06, 2003
Posts: 6

Hello 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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-scott
Post subject:   PostPosted: Jun 17, 2003 - 07:53 PM
Moderator
Moderator


Joined: May 06, 2003
Posts: 6760

Gerald,

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
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-scott
Post subject:   PostPosted: Jun 24, 2003 - 03:05 PM
Moderator
Moderator


Joined: May 06, 2003
Posts: 6760

The problems identified in this thread were address in MyEclipse v2.1.1 EA2.

--Scott

_________________
--Scott
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits