-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi! I am new to ZK. Is it possible to create new directories under WEB-INF in zk? I cannot seem to be able to make java.io.File work...Thanks
I am not sure this is a ZK issue.
application.getRealPath()
Thanks for the info. Um, how about if I want to get the file's path in the disk like for example, "C:/workspace/zss/WebContent..."?
Doesn't application.getRealPath() already return this?!
Hi again. My project can be found in D:\workspace but when I tried using
application.getRealPath("/")
Well... this is where Eclipse's Tomcat instance is actually deploying on the fly your application for development/testing purposes.
So the value obtained is correct.
You will never be able to get the Workspace location - i.e. where e.g. Eclipse is storing project files.
Your application is instead able to look at the position where it is deployed.
Suppose you will deploy under Tomcat, you will get:
C:\Programs\Tomcat\webapps\dataLoad\
Maybe if you explain what you have to do and why... ;)
Thanks for clarifying. I tried deploying it by not using Eclipse and the path being returned is the one I need.
Great, good luck!
Asked: 2011-03-28 03:32:02 +0800
Seen: 211 times
Last updated: Mar 28 '11