EL表达式和request.getParameter()接收请求参数

来源:互联网 发布:2016人工智能大会 编辑:程序博客网 时间:2024/06/10 15:04
<%@ page contentType="text/html" pageEncoding="gbk"%>
<html>
<head>
<title></title>
</head>
<body>
<h3>通过内置对象接收输入函数:<%=request.getParameter("ref") %></h3>
<h2>通过EL表达式接收输入函数:${param.ref}</h2>
</body>

</html>


运行此JSP,在地址栏中加上要传递的参数

http://localhost:8080/jspp/cui4.jsp?ref="lihua"

其运行结果如下


谨记:param是针对于EL表达式的。

0 0