Spring3 中,用原始的form表单提交数据时,在类中怎么取的字段的值,
jsp页面代码:
<form name="loginForm" method="post" action="login">
<table>
<tr>
<td>
用户名:<input name="operator_id" type="text">
<input name="submit" type="submit">
</td>
</tr>
</table></form>
类
@Controller
public class LoginAction {
@RequestMapping("/login")
public String login2(HttpServletRequest request, HttpServletResponse response)
{
log.debug(request.getParameter("operator_id"));
return "index";
}
}
jsp页面代码:
<form name="loginForm" method="post" action="login">
<table>
<tr>
<td>
用户名:<input name="operator_id" type="text">
<input name="submit" type="submit">
</td>
</tr>
</table></form>
类
@Controller
public class LoginAction {
@RequestMapping("/login")
public String login2(HttpServletRequest request, HttpServletResponse response)
{
log.debug(request.getParameter("operator_id"));
return "index";
}
}
解决方案 »
- java urlrewrite 访问的页面样式失效
- tomcat加载问题
- 用jdom解析xml文件:org.jdom.input.JDOMParseException: Error on line 1: Content is not allowed in prolog.
- 大家好,关于《精通Spring2x企业应用开发详解》中chapter2中的例子,想改造成一个remote服务,但是都没成功,大家帮忙看看
- 关于hibernate中的generator问题
- 求助:请问哪位朋友知道WEBSPHERE那里有下载啊?谢谢
- 几个和weblogic有关的问题
- 关于struts,大家一起来交流!分虽然少?但顶者有分
- 初学EJB部署的简单问题
- 请问J2SDKEE1.3.1中启动cloudview的命令是什么?
- 一个简单问题,竟然试不出来,特求教:struts2标签中得到web应用上下文路径?
- SHH整合Cookie取值问题~!大侠求助。。。。。。。。。
public String login(HttpServletResponse response,PersonEntity person,HttpServletRequest request) throws IOException {
<form action="login.do" name="person" id="form" method="post">
你试下吧 应该是你的 form action写错了吧
然后直接用 request.getParameter就能的到了