老师,我交错了一个类。。。。
package homework07.servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.List; 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 Service.EmDemo1; import Service.MmDemo1; import Service.PmDemo1; import homework07.demo.Em; import homework07.demo.Mm; import homework07.demo.Pm; /** * Servlet implementation class eidt */ @WebServlet("/job/edit") public class Reidt extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public Reidt() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { //完成数据修改; //创 request.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); List<Mm>list=new MmDemo1().addList(); List<Pm> list1=new PmDemo1().addList(); List<Em> list2=new EmDemo1().addList(); PrintWriter writer=response.getWriter(); writer.write("<!DOCTYPE html><html>"+"<head>"+ "<meta charset=\"UTF-8\">"+"<title>Insert title here</title>"+"</head>"+"<body>"); writer.write("<form action ='eidt' >"); writer.write("职位:"+"</br>"); writer.write("<select name='ePost'>"); for(Pm m:list1) { writer.write("<option>"+m.getPost()+"</option>"); } writer.write("</select>"+"</br>"); writer.write("薪资水平"+"</br>"); writer.write("<select name='mLevel'>"); for(Mm m:list) { writer.write("<option>"+m.getLevel()+"</option>"); } writer.write("</select>"+"</br>"); writer.write("姓名:"+"</br>"); writer.write("<select name='eName'>"); for(Em m:list2) { writer.write("<option>"+m.getName()+"</option>"); } writer.write("</select>"+"</br>"); writer.write("<input type='submit' value='保存'>"); writer.write("</form>"); writer.write("</body></html>"); }/** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }