views:

330

answers:

3

I've been following the Google App Engine tutorials, and I'm having a problem with the .jsp file. Here is the code from Google: Using JSPs. I'm using Eclipse to build my project, and for some reason when I add the guestbook.jsp file to the war directory, it instantly gets a red error icon. I can't double click to open guestbook.jsp either. What could be going on here?

alt text

+1  A: 

3 Suggestions:

  1. Do a project-->Clean
  2. Make sure you have this in web.xml:

    <welcome-file-list> <welcome-file>guestbook.jsp</welcome-file> </welcome-file-list>

  3. Have Project-->Build Automatically enabled, I deployed a Java app on AppEngine long time back and I see a classes folder in the WB-INF folder which has the class of the servlet and the META-INF folder.

zengr
Tried all that.
Nifle
+4  A: 

In the end I seem to have wasted my bounty as I found the solution (with a little help) myself.

The problem arose because I was unfamiliar with Eclipse. When I found the more verbose error message Your project must be configured to use a JDK in order to use JSPs guestbook.jsp. It was located in a tab called 'Markers' in pane found at the bottom of the Eclipse window. alt text It seems that Eclipse wasn't aware that I had installed the JDK.

In Eclipse I went to menu Window->Preferences->Java->Installed JREs . Eclipse had only one entry there named jre6 I clicked the Add... button Chose Standard VM and browsed to the base directory of the jdk (in my case C:\Program Files\Java\jdk1.6.0_20)

I rebuilt my project but the same error was there. I had forgotten to check the box that tells Eclipse to use the jdk instead of the jre. alt text

As soon as I did that Eclipse rebuilt my project and the error was gone.

Nifle