在java中怎么引入类型 eclipse import
展开全部
package cn.mark.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.marking.bean.Teacher;
import cn.marking.mysql.ConnectMySql;
@WebServlet(name="Mark",urlPatterns={"/Mark"})
public class Mark extends HttpServlet
{
private String name = null;
private int array[] = new int[4];
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
response.setContentType("text/html");
name = request.getParameter("name");
array[0] = new Integer(request.getParameter("score1"));
array[1] = new Integer(request.getParameter("score2"));
array[2] = new Integer(request.getParameter("score3"));
array[3] = new Integer(request.getParameter("score4"));
Teacher teacher = new Teacher(0, name, array[0], array[1], array[2], array[3]);
int code = new ConnectMySql().mark(teacher);
if(code == 0)
{
PrintWriter writer = response.getWriter();
writer.write("抱歉!投票失败!请核对表单后再次投票!");
writer.flush();
writer.close();
}
else
{
response.sendRedirect("result.jsp");
}
}
}
2016-11-18
展开全部
import 类的完整地址 或者使用快捷键control+shift+O
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询