请问JSP页面中的<input value =“值">标签里的值如何传到另一个JSP中使用?
1个回答
展开全部
<form action="传到的jsp" name="login" method="post" >
<td >用 户:</td>
<td ><input type="text" name="username" ></td>
</tr>
<tr>
<td >密 码:</td>
<td ><input type="password" name="password" ></td>
</tr>
</form>
2、获取传递的值代码:
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
String username=request.getParameter("username");
String pwd=request.getParameter("password");
<td >用 户:</td>
<td ><input type="text" name="username" ></td>
</tr>
<tr>
<td >密 码:</td>
<td ><input type="password" name="password" ></td>
</tr>
</form>
2、获取传递的值代码:
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
String username=request.getParameter("username");
String pwd=request.getParameter("password");
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询