zoukankan      html  css  js  c++  java
  • request 请求转发

    package request;

    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    //request请求转发,以及使用request域对象吧数据带给转发资源
    public class RequestDemo5 extends HttpServlet {
        //用congtext存数据是行不通的,但是request存数据是可以的,每个请求对象都有唯一的request
        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            String data = "aaaaaa";
            request.setAttribute("data", data);
            //request也可实现转发
            request.getRequestDispatcher("/message.jsp").forward(request, response);
        }
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            doGet(request, response);
        }

    }

  • 相关阅读:
    K8S-安全机制
    K8S-Service
    K8S-Pod资源管理
    K8S-kubelet启动过程
    每日进度
    每日进度
    每日进度
    每日进度
    每日进度
    归纳及计划
  • 原文地址:https://www.cnblogs.com/siashan/p/3914737.html
Copyright © 2011-2022 走看看