request请求方法

<%@ page import="java.util.Arrays" %><%--
Created by IntelliJ IDEA.
User: admin
Date: 2022/6/5
Time: 14:23
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<%-- <%--%>
<%-- Integer d = (Integer) request.getAttribute("k");--%>
<%-- %>--%>
<%-- <%=d%>--%>
<%
request.setCharacterEncoding("UFT-8");乱码解决编码
String[] names = request.getParameterValues("name");数组
%>
<%=
Arrays.toString(names)
%>
String id = request.getParameter("id");客户端传
Integer ids = Integer.parseInt(id);
ids++;
request.setAttribute("ids",ids);传内部
request.getRequestDispatcher("in.jsp").forward(request,response);请求转发
Integer i =(Integer) request.getAttribute("ids");//gey方法取出value

</body>
</html>
posted @ 2022-06-05 14:33  小松2739  阅读(92)  评论(0编辑  收藏  举报