request.getServletContext()只能在jdk6以上
来源:互联网 发布:心中的秘密知乎 编辑:程序博客网 时间:2024/05/17 22:35
要在Java 6.0 以上才能够使用request.getServletContext
ServletRequest的getServletContext方法是Servlet3.0添加的,这个可以看一下官方文档
http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getServletContext()
而Tomcat6只支持到Servlet2.5看它的官方文档可以知道,要用J2EE6的话得换成Tomcat7
http://tomcat.apache.org/tomcat-6.0-doc/index.html
旧版本需要先用request拿到HttpSession或者通过Servlet自身拿到ServletConfig之后再获取ServletContext
阅读全文
0 0
- request.getServletContext()只能在jdk6以上
- request.getServletContext()只能在jdk6以上
- request.getSession().getServletContext().getRealPath("/");
- request.getServletContext()的问题
- request.getServletContext()的问题
- 解决recyclerView.setOnScrollChangeListener只能只能在api23以上使用问题
- 在servlet 中使用 request.getSession().getServletContext().getRealPath("upload/" ); 获取不到 tomcat 服务器目录
- request.getSession().getServletContext().getRealPath 为null
- request.getSession().getServletContext() 意思,为什么为空!
- getServletContext()
- request.getRealPath("/");替换为request.getSession().getServletContext().getRealPath("/");
- request.getSession().getServletContext().getRealPath(“/updload/video/”) 得到项目的绝对路径
- weblogic session的共享--貌似只能在weblogic9以上才可以
- 有关请求路径的总结 request.getContextPath()、request.getServletContext().getRealPath("")、request.getRequestURI
- 在Ubuntu上安装JDK6
- 在Ubuntu上安装JDK6
- 解决在Tomcat7.0以上版本,Invalid character found in the request target问题
- request.getinputstream只能读取一次
- HttpClient使用详解
- Qt退出码255
- vim计算器
- nmcli命令集
- poj2109 Power of Cryptography【坑~泪目】【水过~】【刷题计划】
- request.getServletContext()只能在jdk6以上
- 高性能服务器编程-多进程编程与多线程编程
- NVIDIA新作解读:用GAN生成前所未有的高清图像(附PyTorch复现) | PaperDaily #15
- Java面试的一些总结
- Mybatis返回Map时,如果值为空的话,那么key也不会被加入到map中的解决办法
- [Eclipse]svn: E200007: Runner for 'org.tmatesoft.svn.core.wc2.SvnMerge' command have not been found;
- SpringMVC(一)初步认识
- 洗牌算法
- 记一次网站运行速度变慢的诊断修复过程