Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.jsp file not working for Google App Engine guestbook tutorial

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? enter image description here

like image 510
Petwoip Avatar asked Jun 24 '10 17:06

Petwoip


3 Answers

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. enter image description here 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. enter image description here

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

like image 136
Nifle Avatar answered Oct 15 '22 07:10

Nifle


Buddy

It'simple just select project->rightclick->properties->java Build path->select your jre->edit->alternate jre->select your jdk there.

So simple right.

One more thing that you have to do is to change is (Project facet) select perhaps it will ask for apply then apply if it didn't then change java level(check box) to 1.6 or 1.7 the jdk you have selected.

cheers.... Parveen Verma

like image 3
Parveen Avatar answered Oct 15 '22 07:10

Parveen


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.

like image 2
zengr Avatar answered Oct 15 '22 06:10

zengr