有关java路径

来源:百度知道 编辑:UC知道 时间:2024/05/07 18:02:48
学java有段时间了,不过在路径的问题还是不是很清楚,
请大家详细点告诉我好吗?
举个例子:
frm.action = "../monthFundPlan/monthFundPlanAction.do?action=save&caSn="+$F("caSn");
在这里指定路径的时候这里用到../。
问题:
../monthFundPlan/monthFundPlanAction.do
./monthFundPlan/monthFundPlanAction.do
/monthFundPlan/monthFundPlanAction.do
monthFundPlan/monthFundPlanAction.do
请说出这4种是什么意思,主要问前面的符合(本题50分,答错不得分)

“..”是指本目录的上一级目录
“.”是指当前目录
所以,第一个是指当前目录的上一级目录下的monthFundPlan/......
第二个和第四个是一样的,是指当前目录下的monthFundPlan/......
第三个是指根目录下的monthFundPlan/......

在F:/A/B/C下
那么 ../C就是 F:/A/B
那么 ../B就是 F:/A
./C或者C就是 F:/A/B/C
/C 是指 F:/C

../monthFundPlan/monthFundPlanAction.do
(html)在当前目录中退回一层之后可以找到的

./monthFundPlan/monthFundPlanAction.do

/monthFundPlan/monthFundPlanAction.do
一般在Struts标签里面表示从当前目录项下查找

monthFundPlan/monthFundPlanAction.do
(html)在当前目录中向下查找可以找到

都是相对路径的表示方法

这个路径应该是web项目中的路径吧
1)../monthFundPlan/monthFundPlanAction.do 是当前路径的上一个路径
比如说:现在访问的是http://www.baidu.com/sss/shhd.do?method=uu
然后调用../monthFundPlan/monthFundPlanAction.do 就是在shhd.do的上一路径sss 所以相当于调了http://ww