jsp a href怎么传参数?

jsp中超链接传值使用键值对格式,多个键值对之间用&分隔,即
<a href="show.jsp?name=tom&pass=123&score=78,5">连接</a>
取值则使用request对象即可
<%
String username=request.getParameter("name");

String userpass=request.getParameter("pass");
String score=request.getParameter("score");
%>
注意:
1、超链接传值传递的都是String类型,如果需要其他类型,则需要进行类型转换
2、超链接传值有长度限制,最长不能超过255个字符,从?后开始算起

原文地址:https://www.cnblogs.com/borter/p/9468964.html