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?
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.
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.
As soon as I did that Eclipse rebuilt my project and the error was gone.
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
3 Suggestions:
Make sure you have this in web.xml:
<welcome-file-list>
<welcome-file>guestbook.jsp</welcome-file>
</welcome-file-list>
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With