Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not create servlet in web application project (google app engine) by using eclipse

I am following Google App Engine Guestbook sample to create a new servlet in src folder. When the create servlet dialog open, I found I can't choose or type "Web Project" and can't browse to select "source folder" either.

The eclipse is version 3.5, jdk I installed is 1.6.0_14-b08

I am working on Windows XP Pro with SP3.

Before I tried to create new servlet, I can compile and start the server, after visiting http://localhost:8080, sample app works fine.

Please advise. Thanks.

like image 508
machinegone Avatar asked Oct 01 '09 19:10

machinegone


People also ask

How do I run the Google App Engine in eclipse?

To create a new project for the App Engine standard environment in Eclipse: Click the Google Cloud Platform toolbar button . Select Create New Project > Google App Engine Standard Java Project. Enter a Project name and (optionally) a Java package.


3 Answers

This happens if none of your projects were created as "Dynamic Web Project". For example if you did :

New --> Maven Project --> maven-archetype-webapp --> etc.

To correct this either create a project via:

New --> Dynamic Web Project

or right-click your existing project and do:

Properties --> Project Facets --> Convert to facet form...

TickDynamic Web Module(verifying the version) then clickOK

like image 108
DJDaveMark Avatar answered Oct 16 '22 18:10

DJDaveMark


Same here. In the Create Servlet dialog (opened by right clicking on the package in my project, New > Other, then choose Web > Servlet), there is no choice in the "Project" drop down list: alt text

The "Browse" buttons for Source folder and Java package doesn't work either.

Installing GWT Web Project and adding such support in the existing project don't help. BTW, the project is already a Web Application Project created following the instructions stated here: http://code.google.com/appengine/docs/java/gettingstarted/creating.html

Instead, I have to create a Class and then manually set the superclass as javax.servlet.http.HttpServlet to add a servlet to the project.

Is it a bug in Google Plugin or Eclipse?

like image 29
circle Avatar answered Oct 16 '22 18:10

circle


That may be because you did not installed the GWT (Google Web Toolkit) eclipse plugin first.

alt text http://download.instantiations.com/DesignerDoc/integration/latest/docs/html/gwt/images/web-new-project1.gif

See also this GWT Web Project guide.

like image 34
VonC Avatar answered Oct 16 '22 18:10

VonC