【Web】HttpServletRequest request 相关方法 得到路径
username=qqqq
password=wwww
//----------------------POST------------------->
request.getContextPath() =/demo
request.getMethod() =POST
request.getRequestURI() =/demo/reg
request.getRequestURL() =http://192.168.1.211:8080/demo/reg
request.getServletPath() =/reg
//-----------------------GET------------------->
http://192.168.1.211:8080/demo/index.jsp?username=1&password=1&email=1
request.getContextPath() =/demo
request.getMethod() =GET
request.getQueryString() =username=1&password=1&email=1
request.getRequestURI() =/demo/index.jsp
request.getRequestURL() =http://192.168.1.211:8080/demo/index.jsp
request.getServletPath() =/index.jsp
【Web】HttpServletRequest request 相关方法 得到路径的更多相关文章
- day10(java web之request&respone&访问路径&编码问题)
day10 请求响应流程图 response response概述 response是Servlet.service方法的一个参数,类型为javax.servlet.http.HttpServletR ...
- [原创]java WEB学习笔记47:Servlet 监听器简介, ServletContext(Application 对象), HttpSession (Session 对象), HttpServletRequest (request 对象) 监听器,利用listener理解 三个对象的生命周期
本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...
- java web HttpServletRequest
一.HttpServletRequest介绍 HttpServletRequest 对象代表客户端的请求,当客户端通过HTTP协议访问服务器时,通过这个对象提供的方法,可以获得客户端请求的所有信息. ...
- java web项目中 获取resource路径下的文件路径
public GetResource{ String path = GetResource.class.getClassLoader().getResource("xx/xx.txt&quo ...
- web与request
request --> 封装了客户端所有的请求数据! 请求行 请求头 空行 请求体(GET没体) 回忆一下http协议!请求协议中的数 ...
- java web(四):request、response一些用法和文件的上传和下载
上一篇讲了ServletContent.ServletCOnfig.HTTPSession.request.response几个对象的生命周期.作用范围和一些用法.今天通过一个小项目运用这些知识.简单 ...
- Eclipse中修改Web项目的URL访问路径
背景 访问路径,也就是指在浏览器中访问该web系统时的根路径,比如http://localhost:8080/xxxx/index.jsp 这里的xxxx,也就是request.getContext ...
- request 获取各种路径
从request获取各种路径总结 request.getRealPath("url"); // 虚拟目录映射为实际目录 request.getRealPath("./&q ...
- request获取各种路径
equest.getRealPath() 这个方法已经不推荐使用了,代替方法是: request.getSession().getServletContext().getRealPath() 在ser ...
随机推荐
- 类中成员函数与数据成员private/pubic/protected
类中成员函数与数据成员private/pubic/protected
- Sqoop mysql 数据导入到hdfs
1.--direct 模式使用mysqldump 工具,所以节点上需要安装该工具,非direct 模式直接使用jdbc ,所以不需要 具体script参考如下: sqoop import --conn ...
- Githut Token (hidden): Githut 安装验证
登录https://github.com 进入https://github.com/settings/profile 参考 http://jingyan.baidu.com/article/22fe7 ...
- IOS 学习笔记(1) 视图UIViewController
1.UIViewController *newController=[[UIViewController alloc] initWithNibName:@"XXX" bundle: ...
- js运算符(运算符的结合性)
1.javascript具有下列种类的运算符:算术运算符;逻辑运算符;比较运算符; 2.目的分类:字符串运算符;逻辑运算符;逐位运算符;赋值运算符; 3.特殊运算符:条件运算符;typeof运算符;创 ...
- 盛希泰:办公室就像男人的春药——人的一生的精力是有限的,你把有限的时间分配给谁决定你的成败——你有N多选择,你人生的积累就是N多选择加起来的结果
欢迎关注“创事记”的微信订阅号:sinachuangshiji 创事记注:12月22日晚上,盛希泰在清华大学旧经管报告厅面对清华师生讲了一堂<创业引导课>.本文由洪泰帮根据课堂录音整理完成 ...
- 宣布发布 Windows Azure SDK 2.2,正式发布 Windows Azure Backup 和 Hyper-V 恢复管理器预览版
开发人员正逐渐转向云计算,因为它具有众多优势,包括成本.自动化和让开发人员专注于应用程序逻辑的能力.我们很高兴地宣布,继推出 Visual Studio 2013 之后,今天将发布 Windows A ...
- Libev学习笔记3
设置完需要监听的事件之后,就开始event loop了.在Libev中,该工作由ev_run函数完成.它的大致流程如下: int ev_run (EV_P_ int flags) { do { /* ...
- http://download.qt-project.org/archive/qt/4.5/qt-all-opensource-src-4.5.2.tar.bz2
Index of /archive/qt/4.5 http://download.qt-project.org/archive/qt/4.5/qt-all-opensource-src-4.5.2.t ...
- 具体解释VMware 9.0.1安装MAC OS X 10.8(历时近3日感想篇)
突然心血来潮,想用VMware 9.0.1安装MAC OS X,但网上的文章多多少少总有点缺陷,不能适合每个人,在综合了近30篇安装MAC OS X的文章后,我决定公布一篇比較大众化,比較详尽的MAC ...