HttpServlet "cannot be resolved to a type" [message #92967] |
Tue, 19 April 2005 02:02 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: jbailo.vestcom.com
I'm trying to run this code (see below) from a tutorial about creating a
web applicaiton in Eclipse.
The problem is the "HttpServlet" throws a message in the IDE that it:
"Cannot be resolved to a type". Why?
____________________________________________________________ ____________________
package org.eclipse.wtp.tutorial;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class SnoopServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String userAgent = req.getHeader("user-agent");
String clientBrowser = "Not known!";
if( userAgent != null)
clientBrowser = userAgent;
req.setAttribute("client.browser",clientBrowser );
req.getRequestDispatcher("/showBrowser.jsp").forward(req,resp);
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03792 seconds