This problem is a headache for beginners.
Although there is no difficulty, but you have to search for a good tutorial.
Plus the first two lines in the Doget
protected void doget (httpservletrequest request, httpservletresponse response) throws Servletexception, IOException { // TODO auto-generated Method stub // response.getwriter (). Append ("Served at:"). Append (Request.getcontextpath ()); Request.setcharacterencoding ("utf-8");/ 必须写在第一位,因为采用这种方式去读取数据,否
/
Response.setcontenttype ("Text/html;charset=utf-8")///Set the encoding of the page display to pass the String method=request.getparameter ("Method"); Try { if("Show". Equals (method)) {Show (request,response); } Else if("Add". Equals (method)) {Add (request, response); } } Catch(SQLException e) {//TODO auto-generated Catch blockE.printstacktrace (); } }
Problem solving.
Solve the Java Web before and after the table garbled