myEclipse 为何不能导入Servlet?找不到 javax.servlet.*

tanyuqiong 2007-09-26 03:23:28
在myEclipse 5.5 GA 中
找不到Servlet相关的库呀?
import javax.Servlet.*;
是啥问题呢?
...全文
233 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
richard_first 2007-09-26
  • 打赏
  • 举报
回复
Servlet小写
import javax.servlet.*;
import java.io.IOException; import java.io.PrintWriter; import java.util.*; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * @author xiaoq * */ public class AddVoteServlet extends HttpServlet { /** * Constructor of the object. */ public AddVoteServlet() { super(); } /** * Destruction of the servlet.
*/ public void destroy() { super.destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doPost method of the servlet.
* * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=GBK"); PrintWriter out = response.getWriter(); out.println(""); out.println(" add vote"); out.println(" "); String title=request.getParameter("title"); String stile=request.getParameter("stile"); String startTime=request.getParameter("startyear")+"-"+request.getParameter("startmonth")+"-"+ request.getParameter("startday"); String endTime=request.getParameter("endyear")+"-"+request.getParameter("endmonth")+"-"+ request.getParameter("endday"); String active=request.getParameter("active"); int newActive=Integer.parseInt(active); /**test out.println(title+""+stile+""+endTime+""+startTime+""+newActive+""); */ Questions question=new Questions(); question.setTitle(title); question.setStyle(stile); question.setStrStartime(startTime); question.setStrEndtime(endTime); question.setActive(newActive); int n=Integer.parseInt(request.getParameter("n")); Collection items=new ArrayList();

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧