Advertisement

09.23.2007 at 06:34PM PDT, ID: 22847477
[x]
Attachment Details

"Cannot be resolved to a type"

Asked by jpking72 in Java Servlets, Java Programming Language

Tags: resolved, cannot, type

I'm trying to create a web app with Eclipse, but when I create the servlet, I get the error "Cannot be resolved to a type" everywhere. For HttpServletRequest, HttpServletResponse, javax.servlet, etc.  What is the problem?

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * Servlet implementation class for Servlet: Acceptinfo
 *
 */
 public class Acceptinfo extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
   static final long serialVersionUID = 1L;
   
    /* (non-Java-doc)
       * @see javax.servlet.http.HttpServlet#HttpServlet()
       */
      public Acceptinfo() {
            super();
      }         
      
      
      
      /* (non-Java-doc)
       * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/html");
            PrintWriter out = response.getWriter();
            out.println("<HTML><HEAD><TITLE>Hello Client!</TITLE>"+
            "</HEAD><BODY>Hello Client!</BODY></HTML>");
            out.close();
      }        
      
      /* (non-Java-doc)
       * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
             doGet(request, response);
      }                    
}Start Free Trial
[+][-]09.23.2007 at 07:27PM PDT, ID: 19946235

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.23.2007 at 07:31PM PDT, ID: 19946255

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.23.2007 at 07:45PM PDT, ID: 19946325

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.23.2007 at 08:13PM PDT, ID: 19946378

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.23.2007 at 08:35PM PDT, ID: 19946426

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.23.2007 at 09:38PM PDT, ID: 19946563

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.24.2007 at 02:16AM PDT, ID: 19947144

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.24.2007 at 05:39AM PDT, ID: 19947856

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Servlets, Java Programming Language
Tags: resolved, cannot, type
Sign Up Now!
Solution Provided By: malfunction84
Participating Experts: 4
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628