jsp页面的主要代码:
<form name="f1">
<br>
<br><br><br><br><br><br><br><br>
<table frame="box" rules="none" cellspacing="0" class=bl>
<tr height="70" >
<td><font color="orange" size="3">*</font></td>
<td><font color="#72081c" size="4"><b>用户帐号名</b></font></td>
<td><input type="text" name="userName"></td>
<td><font size=2 color="#3c740f">用户帐号只能使用英文字母、数字和_号,不能使用中文、空格以及其他特殊字符</font></td>
</tr>
</table>
<br>
<font color="blue">...............................................................................................................................................................................................</font>
<br><br>
<a href="inUser.action" ><img src="img/continue.jpg" border=0 onClick="return CheckValue();"></a>
</form>
action中的代码:
public String execute()throws Exception
{
HttpServletRequest request = ServletActionContext.getRequest();
String userName=request.getParameter("userName");
System.out.println("用户帐号:"+userName);
return "succ";
//如果用户帐号存在,就返回fail
/*if(userDao.getUser(username)==null)
{
user1.setUsername(username);
userDao.addUser(user1);
return "succ";
}else{
request.setAttribute("mess",
"<script language='javascript'>alert('该用户帐号已存在!')</script>");
return "fail";
}*/
}
userName得到的一直是null。请问这样的问题,应该怎样在action中获得jsp页面中某个文本框的值。谢谢