最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
jsp request.getParameter()接受表单和url数据代码
时间:2022-06-29 02:39:38 编辑:袖梨 来源:一聚教程网
request.getParameter()方法传递的数据,会从Web客户端传到Web服务器端,代表HTTP请求数据。request.getParameter()方法返回String类型的数据。
<%@ page import="java.util.*" %>
<%
String title = "HttpServletRequest Method Values";
Map entries = new TreeMap();
entries.put("getCharacterEncoding", request.getCharacterEncoding());
entries.put("getContentLength", "" + request.getContentLength());
entries.put("getContentType", request.getContentType());
entries.put("getLocale", request.getLocale());
entries.put("getProtocol", request.getProtocol());
entries.put("getRemoteAddr", request.getRemoteAddr());
entries.put("getRemoteHost", request.getRemoteHost());
entries.put("getScheme", request.getScheme());
entries.put("getServerName", request.getServerName());
entries.put("getServerPort", "" + request.getServerPort());
entries.put("isSecure", "" + request.isSecure());
request.setAttribute("_table_title", title);
request.setAttribute("_table_entries", entries);
out.println(request.getCharacterEncoding());
%>
request.getParameter()取得是通过容器的实现来取得通过类似post,get等方式传入的数据
Request Information
JSP request method: <%= request.getMethod() %>
URL for the request: <%= request.getRequestURI() %>
Protocol of the request: <%= request.getProtocol() %>
Server name: <%= request.getServerName() %>
Path: <%= request.getServletPath() %>
Server port: <%= request.getServerPort() %>
Remote address: <%= request.getRemoteAddr() %>
Remote host: <%= request.getRemoteHost() %>
Locale: <%= request.getLocale() %>
User agent: <%= request.getHeader("User-Agent") %>
来自get 数据
Retrieving the Original URI
In ShowPath1.jsp教程:request.getRequestURI() =
<%= request.getRequestURI() %>request.getServletPath() =
<%= request.getServletPath() %>
<jsp:include page="ShowPath2.jsp" flush="true"/>
相关文章
- 人们熟悉的寄居蟹属于以下哪种分类 神奇海洋11月21日答案 11-21
- 第五人格11.22共研服有什么更新 11月22日共研服更新内容介绍 11-21
- 原神恰斯卡怎么培养 11-21
- 无期迷途四星装束是谁 11-21
- 王者荣耀帝丹高中校服怎么获得 11-21
- 光遇姆明季后续版本怎么玩 11-21