Reputation: 249
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.
Upvotes: 11
Views: 6637
Reputation: 4494
It's seems to be an old known missing feature/bug.. Gae issue link From my experience today (06-2014), it has still not been dealt with yet.
Reported by [email protected], Oct 22, 2009
Eclipse provides a wizard to create new servlets. This wizard allows to create servlets for dynamic web projects only.
The projects created the the Google Plugin do not have the right nature, so you cannot use the wizard to create servlets.
Can you please fix this?
Example:
- Create a new "Web Application Project". Select File -> New -> Other -> Servlet
- Look at the wizard
Upvotes: 0
Reputation: 2855
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
Upvotes: 4
Reputation: 1
solution to this problem is very simple, create a simple servlet file in notepad and copy that file into your projects package folder, and then start editing the file in eclipse.
Upvotes: 0
Reputation: 122
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:
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?
Upvotes: 2
Reputation: 1326766
That may be because you did not installed the GWT (Google Web Toolkit) eclipse plugin first.
See also this GWT Web Project guide.
Upvotes: 1