Reputation: 47
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
Views: 263
Reputation: 37778
You can go to "Project > Properties > Project Facets" and enable 'Dynamic Web Module'
If you have installed the JavaEE edition of Eclipse (or alternatively the corresponding plugins), you should then see the "New > Servlet" action in your project's context menu.
Note: Depending on the active perspective, the action may be hidden under "New > Other > Web > Servlet".
Upvotes: 1
Reputation: 64541
I suppose that option is contributed by Eclipse's Web Tools Platform (WTP), which will only add it to "Dynamic Web Project" projects, which your Eclipse project probably isn't (this is similar to the "new UiBinder" wizard contributed by the GPE not being available on non-GWT projects).
In other words, it's not a bug, it's related to the Eclipse facets and natures applied to your project.
If you don't know what a Dynamic Web Project is and/or how to work with it, I'd suggest simply using the "new Class" wizard and chose the right superclass, and manually add the <servlet>
and <servlet-mapping>
configuration to your web.xml.
Upvotes: 1