You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dudu <ed...@yahoo.com.br> on 2006/04/12 19:32:25 UTC

Why I cannot get the path of WEB-INF folder(or any file) on Sun Java System Application Server

If I run on JDev embebbed server, the code below return the path right, like
/d:/jdev/apps/myapp/WEB-INF/

But when I deploy the app on sun app server, the path returned is virtual,
or wrong, I do not know. The path returned is
/server/myapp/WEB-INF/

I think there are a thing wrong inside the file server.policy.
The permissions on server.policy file in sun app server is the below:


// Basic set of required permissions granted to all remaining code
grant {
    permission java.lang.RuntimePermission  "loadLibrary.*";
    permission java.lang.RuntimePermission  "queuePrintJob";
    permission java.net.SocketPermission    "*", "connect";
    permission java.io.FilePermission       "<<ALL FILES>>",
"read,write,delete";

    //ADF
    permission java.net.NetPermission "specifyStreamHandler";

        // work-around for pointbase bug 4864405
        permission java.io.FilePermission
"${com.sun.aas.instanceRoot}${/}lib${/}databases${/}-",
"delete";
        permission java.io.FilePermission "${java.io.tmpdir}${/}-",
"delete";

    permission java.util.PropertyPermission "*", "read";

    permission java.lang.RuntimePermission    "modifyThreadGroup";
};

And the code to return the path is below:

 public static String getWebInfPath() throws IOException {
        String temp = FacesContext.getCurrentInstance().
                getExternalContext().getResource("/WEB-INF/").getPath();

        System.out.println("FOLDER WEB-INF IS HERE => "  + temp);
        return temp;
    }

Thanks!

----------
Dudu
GoogleTalk: eduardopichler[at]gmail[dot]com
skype:eduardopichler