老师,第一个servlet编写包500错误求解,和视频的没区别

来源:-

Jaygee

2015-09-05 11:20



package servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        System.out.println("处理get请求。。。");
        PrintWriter out = response.getWriter();
        out.println("<strong>Hello Servlet</strong><br>");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
    
    }

}


写回答 关注

0回答

还没有人回答问题,可以看看其他问题

JAVA遇见HTML——Servlet篇

本门课程在JSP课程的基础上,深入介绍Servlet的基础知识

160615 学习 · 1029 问题

查看课程

相似问题