<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>EL表达式练习</title>
</head>
<body>
<form action="submit.jsp" method="get" name="myform">
<table width="456" border="1" height="140">
<tr>
<td width="144">
昵称:
</td>
<td width="211">
<input type="text" name="userName" id="t1" />
</td>
</tr>
<tr>
<td>
所在城市:
</td>
<td>
<input type="text" name="userName" id="t2" />
</td>
</tr>
<tr>
<td>
您所使用的开发语言
</td>
<td>
<input type="checkbox" name="checkbox" id="checkbox" />
Java
<input type="checkbox" name="checkbox" id="checkbox2" />
c
<input type="checkbox" name="checkbox" id="checkbox3" />
c++
<input type="checkbox" name="checkbox" id="checkbox4" />
PHP
<input type="checkbox" name="checkbox" id="checkbox5" />
asp
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="button" id="button" value="提交" />
</td>
</tr>
</table>
</form>
</body>
</html>-------------我用el表达式想得到提交后的复选框上按钮的值 怎么写---------我这没写的 : ${paramValues["checkbox"]}
${paramValues.checkbox}
但是给我输出个这个
Ljava.lang.String;@106b56a [Ljava.lang.String;@106b56a 请问高手怎么用el表达式得到我选中的值啊
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>EL表达式练习</title>
</head>
<body>
<form action="submit.jsp" method="get" name="myform">
<table width="456" border="1" height="140">
<tr>
<td width="144">
昵称:
</td>
<td width="211">
<input type="text" name="userName" id="t1" />
</td>
</tr>
<tr>
<td>
所在城市:
</td>
<td>
<input type="text" name="userName" id="t2" />
</td>
</tr>
<tr>
<td>
您所使用的开发语言
</td>
<td>
<input type="checkbox" name="checkbox" id="checkbox" />
Java
<input type="checkbox" name="checkbox" id="checkbox2" />
c
<input type="checkbox" name="checkbox" id="checkbox3" />
c++
<input type="checkbox" name="checkbox" id="checkbox4" />
PHP
<input type="checkbox" name="checkbox" id="checkbox5" />
asp
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="button" id="button" value="提交" />
</td>
</tr>
</table>
</form>
</body>
</html>-------------我用el表达式想得到提交后的复选框上按钮的值 怎么写---------我这没写的 : ${paramValues["checkbox"]}
${paramValues.checkbox}
但是给我输出个这个
Ljava.lang.String;@106b56a [Ljava.lang.String;@106b56a 请问高手怎么用el表达式得到我选中的值啊
解决方案 »
- 求一个计算百分比的算法
- 如何用Javaee配置tomcat和发布项目程序
- 一个ibits更新的问题?
- 关于将sql数据放入数组,使得可以在jsp中调用并显示的问题
- 有谁知道 怎样提取applet里init()方法里的参数出来吗?
- 如何自己写错误页?
- 谁那里有'邮件服务器"的代码
- SQL语句少见问题,过往者都来看看,说不定你也会碰到!
- struts2.3.4+hibernate4.18+spring3.2 自动创建外键关联失败,创建序列失败!
- iframe内嵌页面取不到struts变量值
- jsp页面刷新问题
- 提示 Background Indexer Crash Recovery java.lang.StackOverflowError
你可以在后台用String[] values=request.getParameter("checkbox");来的到这个选中的数组
代码 1 (登陆界面 index.jsp) <form action="info.jsp" method="post"> <table align="center" width="492" height="200" cellspacing="0" cellpadding="0" border="1"><tr>
<td align="right"> 用户名:</td>
<td> <input type="text" maxlength="8" size="8" name="user"></td></tr><tr>
<td align="right"> 密码:</td>
<td> <input type="password" maxlength="8" size="8" name="user"></td></tr><tr>
<td align="right"> 性别:</td>
<td>
<input type="radio" checked="checked" value="男" name="radio">男
<input type="radio" value="女" name="radio">女</td></tr><tr>
<td align="right"> 年龄:</td>
<td> <input type="text" maxlength="8" size="8" name="age"></td></tr><tr>
<td colspan="2" align="center">兴趣爱好:
<input type="checkbox" checked="checked" value="足球" name="hobby">足球
<input type="checkbox" value="乒乓球" name="hobby">乒乓球
<input type="checkbox" value="篮球" name="hobby">篮球</td>
</tr><tr>
<td align="center" colspan="2"> <input type="submit" value="提交" name="button1">
<input type="reset" name="button3" value="重置"></td>
</tr></table>
</form>
代码 2(处理界面 info.jsp)<p align="center"> 个人资料 <br> <br>
<b> 用户 :${param.user}<br><br>
密码 :${param.psw}<br><br>
年龄 : ${param.age}<br><br>
性别 :${paramValues.radio[0]} ${paramValues.radio[1]}<br><br>
兴趣爱好:${paramValues.hobby[0] } ${paramValues.hobby[1] } ${paramValues.hobby[2] }
</p> 希望对你有用