servlet中的几个路径有关的方法
来源:互联网 发布:sql 生成java代码 编辑:程序博客网 时间:2024/05/16 15:34
servlet中的几个路径有关的方法
在编写JSP/Servlet应用时常常需要从传入的链接中提取一些信息。HttpServletRequest提供了多个方法,这些方法之间容易混淆。总结并举例如下,希望能对大家有所帮助。
举例:http://localhost:7001/myservlet/somepath/test?someparam=somevalue
request.getPathInfo():返回/somepath/test
request.getRequestURL():返回http://localhost:7001/myservlet/somepath/test
request.getRequestURI():返回/myservlet/somepath/test
request.getServletPath():返回/myservlet
request.getQueryString():返回someparam=somevalue
在编写JSP/Servlet应用时常常需要从传入的链接中提取一些信息。HttpServletRequest提供了多个方法,这些方法之间容易混淆。总结并举例如下,希望能对大家有所帮助。
举例:http://localhost:7001/myservlet/somepath/test?someparam=somevalue
request.getPathInfo():返回/somepath/test
request.getRequestURL():返回http://localhost:7001/myservlet/somepath/test
request.getRequestURI():返回/myservlet/somepath/test
request.getServletPath():返回/myservlet
request.getQueryString():返回someparam=somevalue
- servlet中的几个路径有关的方法
- servlet中的几个路径有关的方法
- servlet中的几个路径有关的方法
- servlet中的几个路径有关的方法
- WEB基础:几个和路径有关的方法
- servlet中几个获取路径方法的对比
- UIImage有关的几个方法
- 有关字符串的几个方法
- MATLAB基本操作(七):有关文件路径的几个函数在编程中的作用
- MATLAB基本操作(七):有关文件路径的几个函数在编程中的作用
- 关于java中servlet中的路径的几个函数的例子
- c# 有关字符串转换的几个方法
- 有关view加载涉及到的几个方法
- 记录几个和时间有关的方法
- 有关main方法的几个小知识点
- 有关Servlet初始化参数的获取方法
- php几个常用预定义变量,有关路径的
- Android 有关文件路径的常用方法
- 如何自动关闭thickbox窗口
- #pragma 预处理指令详解
- SQL Server 双机互备
- Asp.Net函数集、c#.net函数和方法集
- 生活不可能像你想的那么好,但也不会像你想的那么糟
- servlet中的几个路径有关的方法
- ASP弹出窗口总结
- calm down...
- 程序人生的感想
- Google,baidu免费搜索代码
- 不同List中的值放入对象的方法实例
- eclipse + weblogic 开发配置手顺
- struct成员对齐小解
- iis无法启动,发生意外错误0x8ffe2740