当前位置: 代码迷 >> Eclipse >> import javax.servlet 出错 can't be resolved解决思路
  详细解决方案

import javax.servlet 出错 can't be resolved解决思路

热度:70   发布时间:2016-04-23 14:35:23.0
import javax.servlet 出错 can't be resolved
我建的动态web项目,为什么导入javax.servlet包出错,说导不进来。
而java.io包可以导进来?

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

/**
  *   Servlet   implementation   class   for   Servlet:   HelloWorldServlet
  *
  */
  public   class   HelloWorldServlet   extends   javax.servlet.http.HttpServlet   {
        /*   (non-Java-doc)
  *   @see   javax.servlet.http.HttpServlet#HttpServlet()
  */
public   HelloWorldServlet()   {
super();
}      

/*   (non-Java-doc)
  *   @see   javax.servlet.http.HttpServlet#doGet(HttpServletRequest   request,   HttpServletResponse   response)
  */
protected   void   doGet(HttpServletRequest   request,   HttpServletResponse   response)   throws   ServletException,   IOException   {
//   TODO   Auto-generated   method   stub
}    

/*   (non-Java-doc)
  *   @see   javax.servlet.http.HttpServlet#doPost(HttpServletRequest   request,   HttpServletResponse   response)
  */
protected   void   doPost(HttpServletRequest   request,   HttpServletResponse   response)   throws   ServletException,   IOException   {
//   TODO   Auto-generated   method   stub
}          

------解决方案--------------------
没有 javax 相关包的 lib 引用
  相关解决方案