HttpServletRequest中getAttribute()和getParameter()的区别
1、获取的来源不同
HttpServletRequest类有setAttribute()方法,而
没有setParameter()方法
get/setParameter是在对你的页面中的表单元素进行操作,获取的是这个表单元素中的值,是某个表单提交过去的数据
比如常见的获取POS...
分类:
Web程序 时间:
2014-12-29 16:54:04
阅读次数:
118
首先下载jexcelapi_2_6_12.tar.gz,解压后将里面的jxl.jar复制到WEB-INF/lib目录下面 String filePath = request.getParameter("filePath"); filePath=filePath.r...
分类:
编程语言 时间:
2014-12-16 22:27:14
阅读次数:
250
有时需要获取url传过来的参数,asp.net会通过Request["参数名"]在后台代码获取。如果这个参数值只是在js里用到,可通过以下方法获取值。/*** url 网址* name 参数名*/ var getParameter = function (url, name) { var r = n...
分类:
Web程序 时间:
2014-12-12 18:55:28
阅读次数:
145
1 request.setCharacterEncoding("utf-8"); 2 String name=request.getParameter("name"); 3 //1、设置响应头 4 response.setContentType("a...
分类:
编程语言 时间:
2014-12-11 18:54:36
阅读次数:
162
今天遇到的问题,总结一下jQuery的$ajax({ contentType:"application/json",//发送信息至服务器时内容编码类型。 })这样的方式提交时,如果指定contentType为application/json;此时后台通过传统的getParameter("...
分类:
Web程序 时间:
2014-12-08 17:40:11
阅读次数:
181
我们经常用servlet和jsp, 经常用request.getParameter() 来得到数据。 ? request.getParameter() ?request.getInputStream() ?request.getReader() 这三个方法都是从request对象中得到提交的数据,但是用途不同...
分类:
其他好文 时间:
2014-11-26 11:44:32
阅读次数:
265
1 //包装request,增强getParameter方法 2 class MyReq extends HttpServletRequestWrapper{ 3 private HttpServletRequest req; 4 public MyReq(...
分类:
其他好文 时间:
2014-11-25 18:06:26
阅读次数:
181
1.Struts2页面开发中常用标签使用说明1.1.往action里传值的使用方式: a.userName属性需要在访问的action中提供相应的属性,并有SET/GET方法。b.可以不在访问的action中提供相应的属性,用request. getParameter_r(“userName”);....
分类:
其他好文 时间:
2014-11-19 20:17:35
阅读次数:
165
如何获取地址中的参数想要获取这个链接地址中的参数可以在jsp中用java片段获取,在<head>中<%Stringtype=request.getParameter("type");%><scripttype="text/javascript">vartype=<%=type%>;</script>可以再js中使用这个type,开始只是需要这个..
分类:
其他好文 时间:
2014-11-14 18:05:08
阅读次数:
205
/** * 下载语音 * Remarks: * @throws Exception */public void downloadYuyin() throws Exception { String voiceId = getRequest().getParameter("voiceId"); ...
分类:
数据库 时间:
2014-11-14 10:28:09
阅读次数:
274