比如在后台设置一个值在request里面,request.setAttribute("param",param);
在jsp页面就可以这样获取,${param}; el表达式。
在页面传值到后台中,第一种post方式,提交表单时。
<form action="xxx.do" method="post">
<input type="text" name="username"/>
<input type="password" name="password"/>
<input type="submit"/>
</form>
点击提交按钮后在后台获取Username,和password
String username =request.getParamter("username");
String password=request.getParamter("password");
如果是get方式提交的话
举个例子:
<a href="xxx.do?param1=123">查看</a>
那么在后在获取也是一样的
String param1=request.getParamter("param1");
温馨提示:答案为网友推荐,仅供参考