Am Dienstag, 14. Juni 2005 14:27 schrieb Christian Stalp:
> > Ein grant-Eintrag im Policy-File k�nnte dann so aussehen:
> >
> > grant codeBase "file:${catalina.home}/webapps/my_exec/-" {
> > � � permission java.io.FilePermission "<Pfad zum aszuf�hrenden
> > Programm>", "execute";
> > };
>
> And the "/my_exec/-", is that the context-path?
Yes.
> That means I can call my Servlet whatever I want, but I have to put it into
> a package called my_exec.WAR ? Is that correct?
Well, kind of. The trailing "-" in the path specification above means: grant
that right to all files in this directory and all subdirectories thereof. So,
as a result, the name of your servlet really doesn't matter, since it resides
somewhere in (a subdirectoy of) the webapp-directory.
But better to see it just the other way round: you don't adopt your webapp to
match the configuration parameter but the configuration parameter to match
the webapp.
Example: the servlet that shall be able to execute an external binary is
contained a webapp named "My1stWebApp" which is placed at the default
location (i. e. the location tomcat's default configuration specifies). The
path to your webapp's directory will therefore be
${catalina.home}/webapps/My1stWebApp
and the configuration parameter
grant codeBase "file:${catalina.home}/webapps/My1stWebApp/-" ...
If you have for example placed your webapp in
/some/strange/dir/mywebapps/My1stWebApp
the entry in catalina.policy should the read
grant codeBase "file:/some/strange/dir/mywebapps/My1stWebApp/-" ...
Regards
mks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]