tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Schönhaber <mailing-tomcat-u...@schoenhaber.de>
Subject Re: starting a binary by calling a servlet
Date Tue, 14 Jun 2005 13:17:07 GMT
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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message