getCodeBase()相对路径
getDocumentBase 绝对路径

解决方案 »

  1.   

    YHCS(风中的小刀)这些方法如何用啊
      

  2.   

    把method放在你原本存放路径的地方就可以了。getDocumentBase()
    getDocumentBasepublic URL getDocumentBase()
    Returns an absolute URL naming the directory of the document in which the applet is embedded. For example, suppose an applet is contained within the document:
        http://java.sun.com/products/jdk/1.2/index.html
     
    The document base is:
        http://java.sun.com/products/jdk/1.2/
     
    Returns:the URL of the document that contains this applet.getCodeBasepublic URL getCodeBase()
    Gets the base URL. This is the URL of the applet itself.Returns:the URL of this applet.
      

  3.   

    我不太明白
    String strCount="c:/tomcat/webapps/account/web-inf/classes/db.properties";
    我是指我不知道c:/tomcat/webapps/account这一部分的信息,这是由客户安装的时候他们自己决定的,web-inf/classes/db.properties这部分是固定的,那在c:/tomcat/webapps/account/web-inf/classes/com/company/account/setup/proper.java文件该如何判断db.properties的路径啊?
    谢谢!
      

  4.   

    可不可以这样1。得到你文件所在的绝对路径(strPath)2。对strPath进行处理得到web-inf前面的部分3。在把后面的加上