11-重定向问题
package com.yc.resp;
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 java.io.IOException;
/* 重定向 和 请求转发的区别
重定向 1,两次请求 且 地址变化
2,客户端行为 绝对地址可以写成 http://
* */
@WebServlet("/ser04")
public class servlet04 extends HttpServlet {
@Override
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("ser04.....");
// request.setCharacterEncoding("UTF-8");
// String name = request.getParameter("name");
// System.out.println(name);
response.sendRedirect("ser05");
}
}