如何在eclipse中获取动态项目的绝对路径

2025-03-04 01:36:08
推荐回答(5个)
回答1:

1.鼠标选中项目,右击菜单,选择 properties
2.出来弹出框,选择resource,location 的值就是你想要的项目绝对路径

回答2:

点击项目,右键,属性,就可以看到“位置”,就是绝对路径了。

回答3:

想要获取 ROOT 是么?
这个你使用application就行啊。request.getSession().getServletContext().getRealPath();

a String specifying the real path,
* or null if the translation cannot be performed
这个就是 getRealPath() 的注释。

回答4:

你可以在类里面定义一个变量,用来保存路径,这个路径可以自己拼成的,然后再在页面读取

回答5:

项目右键,属性就能看见了