jsp中怎么获得单选按钮的值

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Jsp Practice</title>
</head>
<script type="text/javascript" language="javascript">


</script>
<body>

<form id="form" method="post" action="test.jsp">
<input type="radio" name="radiobutton" value="OK"/>
<input type="submit" value="提交"/>
</form>
<br/>
以下是从from里面读取的值:
<br/>
<%
String show=request.getParameter("radiobutton");
System.out.println(show);//显示在控制台
out.println(show);//显示在页面,显示结果为  OK
%>
</body>
</html>

你可能感兴趣的:(java,html,jsp)