![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
servlet
核桃x核桃
这个作者很懒,什么都没留下…
展开
-
getContextPath、getServletPath、getRequestURI的区别
假定你的web application 名称为news,你在浏览器中输入请求路径: http://localhost:8080/news/main/list.jsp 则执行下面向行代码后打印出如下结果: 1、 System.out.println(request.getContextPath()); //可返回站点的根路径。也就是项目的名字 打印结果:/news 2、Sy转载 2016-01-04 11:22:57 · 337 阅读 · 0 评论 -
java如何得到GET和POST请求URL和参数列表
刚开始以为request.getQueryString()也能得到post body里面的参数 后来发现其实是行不通的,request.getQueryString()方法只能得到url?后面的参数 以下是网上搜到的post 和get都通用的拿去参数的方法 在servlet中GET请求可以通过HttpServletRequest的getRequestURL方法和getQue转载 2016-04-03 16:44:30 · 4499 阅读 · 0 评论