E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
getRealPath()
String3和Struts2的ServletContextAware接口
但在非Action的类中,如果实现了Struts2的ServletContextAware接口,则调用 String filepath = servletContext.
getRealPath
kerry001
·
2010-07-23 16:00
spring
bean
struts
servlet
Blog
java web ServletContext.
getRealPath
(String str)方法的使用
由于数据库的配置我想做成配置在一个XML文件里,不过,怎么读取都不成功,,后来我在网上查找,通过下面的方式在servlet获取文件的绝对路径,不过由于多了一个/,还是错误 ServletContext context = getServletContext(); String path = context.ge
kalogen
·
2010-07-20 18:00
java
xml
Web
servlet
关于realPath
web应用里通过 request 可以得到某个文件在服务器端的真实路径即绝对路径 request.
getRealPath
("/aaa.txt");已经不推荐使用 request.getSession
lg_aku
·
2010-07-19 20:00
Web
应用服务器
jsp和servlet相对路径和绝对路径
1.JSP中获得当前应用的相对路径和绝对路径: 根目录所对应的绝对路径:request.getRequestURI() 文件的绝对路 径:application.
getRealPath
(request.getRequestURI
fspwp
·
2010-07-14 11:00
jsp
Web
servlet
servlet/jsp 获取绝对路径和相对路径
request.
getRealPath
() 已经不被推荐!
wjt276
·
2010-07-06 10:00
java
jsp
应用服务器
servlet
网络应用
request.
getRealPath
()
request.
getRealPath
("") 就是取得你当前运行文件在服务器上的绝对路径.
wjt276
·
2010-07-06 10:00
request
Application应用
对象的主要作用是保存公共信息 属性操作3个方法 setAttirbute(),getAttirbute(),removeAttirbute() 得到工作目录的真实路径,public String
getRealPath
85977328
·
2010-06-25 15:00
Web
应用服务器
jsp
xml
servlet
Application应用
对象的主要作用是保存公共信息 属性操作3个方法 setAttirbute(),getAttirbute(),removeAttirbute() 得到工作目录的真实路径,public String
getRealPath
85977328
·
2010-06-25 15:00
jsp
应用服务器
Web
xml
servlet
Request中getContextPath、getServletPath、getRequestURI、request.
getRealPath
的区别
假定你的web application 名称为news,你在浏览器中输入请求路径: http://localhost:8080/news/main/list.jsp 则执行下面向行代码后打印出如下结果: 1、 System.out.println(request.getContextPath()); 打印结果:/news 2、System.out.print
小小流浪猪
·
2010-06-25 15:00
tomcat
jsp
Web
浏览器
F#
servlet获得路径
获得项目绝对路径 String filePath=this.getServletConfig().getServletContext().
getRealPath
("/"); 根目录所对应的绝对路径
vager
·
2010-06-10 09:00
Web
servlet
JSP、JAVA获取各种路径总结
3.1 JSP中获得当前应用的相对路径和绝对路径 根目录所对应的绝对路径:request.getRequestURI() 文件的绝对路径 :application.
getRealPath
(request.getRequestURI
zeng168cn
·
2010-06-05 11:00
java
tomcat
jsp
应用服务器
weblogic
js 下怎么找到当前项目名称
<%=getServletContext().
getRealPath
("/web/")%> <%=request.getRequestURI()%><
qqpedily
·
2010-06-03 16:00
jsp
Web
xml
css
JAVA取得WEBROOT物理路径
默认为webapp.root)作为键值, 然后通过Listener , 或者Filter , 或者Servlet 执行String webAppRootKey = getServletContext().
getRealPath
theron19
·
2010-05-28 15:00
java
Web
xml
servlet
sun
servlet路径
1servlet路径 StringwebRealPath=request.getSession().getServletContext().
getRealPath
("/");返回:C:/bea/user_projects
bingmeng
·
2010-05-28 10:00
java文件上传方法
theFile,filePath)说明:theFile:类型是FormFilefilePath:action中路径获取方法 this.getServlet().getServletContext().
getRealPath
xueyepiaoling
·
2010-05-25 17:00
java
exception
Date
String
buffer
action
利用JAVA操作EXCEL文件
(项目的环境是Struts2hibernate3resin3) //Excel文件存放路径Stringpath=ServletActionContext.getServletContext().
getRealPath
mylovedeye
·
2010-05-25 14:00
java
工作
Hibernate
struts
Excel
Path
JSF获取当前应用的路径
HttpServletRequestrequest=(HttpServletRequest)context.getExternalContext().getRequest();StringrootPath=request.
getRealPath
arthur0088
·
2010-05-19 08:00
jsp获取相对地址与url地址
String path=getServletContext().
getRealPath
("/"); System.out.println(path); String url
foolraty
·
2010-05-09 12:00
java
jsp
jsp获取相对地址与url地址
String path=getServletContext().
getRealPath
("/"); System.out.println(path); String url
foolraty
·
2010-05-09 12:00
java
jsp
request.
getRealPath
()的替代方法
获得根路径的几种方法 1,request.
getRealPath
("/");这个方法已不推荐用 2,在Servlet 里用this.getServletContect
yimingchang
·
2010-05-05 16:00
struts
servlet
在servlet中获得项目路径
String filePath=this.getServletConfig().getServletContext().
getRealPath
("/"); 根目录所对应的绝对路径
百威
·
2010-05-04 17:00
Web
.net
jsp
servlet
Blog
在servlet中获得项目路径
String filePath=this.getServletConfig().getServletContext().
getRealPath
("/"); 根目录所对应的绝对路径
百威
·
2010-05-04 17:00
jsp
Web
.net
servlet
Blog
Java相对路径/绝对路径总结
String path = Struts2Util.getServletContext().
getRealPath
("/"); <% String
duanfei
·
2010-04-29 12:00
java
jsp
Web
servlet
weblogic
HttpServletRe中getContextPath、getServletPath、getRequestURI、request.
getRealPath
的区别
假定你的WebApplication 名称为swcrm,你在浏览器中输入请求路径: http://localhost:8080/swcrm/admin/show.jsp则执行下面向行代码后打印出如下结果: 1、 System.out.println(request.getContextPath()); 打印结果:/swcrm 2、System.out.println(request.g
yedehua
·
2010-04-28 10:00
tomcat
jsp
浏览器
F#
sun
WEB应用中 取路径
取Servlet上下文路径,取WebContent(WebRoot)的路径 1、String path = request.
getRealPath
("/cfg.xml") 
litao492700797
·
2010-04-26 11:00
thread
Web
xml
servlet
request.getContextPath(),路径,request.
getRealPath
<%=request.getContextPath()%>是解决相对路径的问题,可返回站点的根路径。 <a href="<%=request.getContextPath()%>/XXX.jsp"> //这样获得的是绝对路径 <a href="XXX.jsp"> //这样获得的是相对路径 &l
_ICE
·
2010-04-12 23:00
html
jsp
Web
浏览器
java读取属性文件
ServletContext context =ServletActionContext.getServletContext(); String strServerPath=context.
getRealPath
zhangym
·
2010-04-09 17:00
java
Web
Spring,控制器中使用request及应用绝对路径
在控制器中,可以通过在方法参数中加入一个request参数就可以得到当前的request对象 然后通过调用request.getSession().getServletContext().
getRealPath
feixingfei
·
2010-04-03 02:00
request
request.getContextPath()用el表达式怎么写,绝对路径:request.
getRealPath
是解决相对路径的问题,可返回站点的根路径。/XXX.jsp">//这样获得的是绝对路径//这样获得的是相对路径/XXXX.jsp">能够更有效的防治连接的失效。request.getContextPath()得到的是项目的名字,如果项目为根目录,则得到一个"",即空的字条串,如果项目为dzjc,/将得到dzjc/,服务器端的路径则会自动加上,应该就是指当前路径下的这个xxx.jsp页面,有时候也可
IBM_hoojo
·
2010-03-22 16:00
html
浏览器
服务器
下载文件
resp) throws ServletException, IOException { try { String filePath = this.getServletContext().
getRealPath
JaneLan
·
2010-03-22 14:00
jsp
F#
JAVA中得到类相关路径 或 Servlet/JSP相关路径的方法
System.out.println(request.getServletPath());System.out.println(request.getContextPath());System.out.println(request.
getRealPath
liangrockman
·
2010-03-19 20:00
在spring的bean中获取ServletContext
进而引申到我需要知道servletContext,因为servletContext有一个servletContext.
getRealPath
("/");方法,这个方法就能获取项目的绝对路径。
沉睡森林@漂在北京
·
2010-03-16 23:00
Jsp、Servlet、Spring controller中获取绝对路径
获取当前web应用的绝对路径 JSP中,可以通过 application.
getRealPath
("/"); 获取.
JuJuo
·
2010-03-15 17:00
spring
jsp
Web
servlet
jdk1.4 windows,unix不同的得到路径方法
jdk1.5以下才需要: String filepath = ""; //如果是nuix filepath = servlet.getServletContext().
getRealPath
yangy608
·
2010-03-12 16:00
java
windows
servlet
unix
Rss-Rome 聚合生成阅读器需要的XML文件
fw = new FileWriter(rssPath); //rssPath:参数,定义xml输出的地址,我选择了放在tomcat的项目中 //String rssPath = request.
getRealPath
guozheng
·
2010-03-10 17:00
tomcat
xml
浏览器
asp
structs2 ServletActionContext类
在获取文件路径上我用到了一个,ServletActionContext.getServletContext().
getRealPath
("/"); 我在Structs2
internetafei
·
2010-03-04 15:00
jsp
Tomcat 路径问题之web 头像
我的tomcat放到d盘下,项目名称为project,则: System.out.println(request.
getRealPath
("")); System.out.println
w0ei2010
·
2010-02-07 15:00
apache
tomcat
Web
jsp
servlet
web开发中获取项目中各种路径
servlet中获得项目绝对路径 String filePath=this.getServletConfig().getServletContext().
getRealPath
("/"); 根目录所对应的绝对路径
hjjk123
·
2010-02-04 17:00
java实用小知识点
如下:application.
getRealPath
("/")+"WEB-INF"+File.separator+"classes"+File.separator+"randomSwitch.propert
shenzhenchufa
·
2010-01-23 17:46
java
职场
休闲
java实用小知识点
如下:application.
getRealPath
("/")+"WEB-INF"+File.separator+"classes"+File.separator+"randomSwitch.propert
shenzhenchufa
·
2010-01-23 17:46
java
职场
休闲
java获取路径
(1)、request.
getRealPath
("/");//不推荐使用获取工程的根路径 (2)、request.
getRealPath
(request.getRequestURI
tiwson
·
2010-01-20 12:00
java
.net
jsp
servlet
Blog
访问资源文件
ServletContext a=this.getServletContext(); String path=a.
getRealPath
("/"); 返回
hngmduyi
·
2010-01-16 17:00
java
apache
tomcat
Web
应用服务器
代码片段
def preview = { def file = new File(servletContext.
getRealPath
("/WEB-INF/docpreview/${params.resourceId
sam.ds.chen
·
2010-01-14 19:00
Web
getRealPath
()出错的问题
1.关于request.
getRealPath
的出错 问题: String filename = request.
getRealPath
(filename) //
wallimn
·
2010-01-13 19:00
tomcat
PHP
Web
weblogic
bbs
getRealPath
()出错的问题
1.关于request.
getRealPath
的出错 问题: String filename = request.
getRealPath
(filename) //
wallimn
·
2010-01-13 19:00
tomcat
PHP
Web
weblogic
bbs
getRealPath
()出错的问题
1.关于request.
getRealPath
的出错 问题: String filename = request.
getRealPath
(filename) //
wallimn
·
2010-01-13 19:00
tomcat
Web
PHP
weblogic
bbs
servlet、jsp中获得项目绝对路径
servlet中获得项目绝对路径StringfilePath=this.getServletConfig().getServletContext().
getRealPath
("/");根目录所对应的绝对路径
JavaAlpha
·
2009-12-31 11:00
jsp
Web
servlet
String
org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed解决
Stringtemp=getServletContext().
getRealPath
("/temp"); Stringupload=getServletContext().
getRealPath
daihui05
·
2009-12-30 11:00
计算类路径,计算Servlet上下文路径
-------------取Servlet上下文路径,取WebContent的路径 -------------------------------- 1、String path = request.
getRealPath
elf8848
·
2009-12-27 09:00
Servlet上下文路径
计算类路径,计算Servlet上下文路径
-------------取Servlet上下文路径,取WebContent的路径 -------------------------------- 1、String path = request.
getRealPath
elf8848
·
2009-12-27 09:00
Servlet上下文路径
上一页
15
16
17
18
19
20
21
22
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他