怎么从JSP页面获取SELECT中value的值

2024-12-02 20:30:05
推荐回答(2个)
回答1:

给你一个列子test.jsp:
<%@ page contentType="text/html;charset=GB2312" %>
<%
String video = request.getParameter("video");
if (video == null) {
video = "没有提交";
} else {
try {
video = new String(video.getBytes("iso-8859-1")); //解决中文乱码
} catch (Exception e) {
video = "值错误";
}
}

%>





您提交的值是:

回答2:

request.getParameter("pl");
pl 为select的name值