Hi,
Your approach is not inelegant, it's fine.  I think the comments above the lines you 
quote explain exactly what they do: without them, when running with a SecurityManager, 
System.getProperty(...) would return null.

Yoav Shapira http://www.yoavshapira.com


>-----Original Message-----
>From: Thomas Zumbrunn [mailto:[EMAIL PROTECTED]
>Sent: Tuesday, October 26, 2004 1:48 PM
>To: [EMAIL PROTECTED]
>Subject: SecurityManager and catalina.policy
>
>Hello list
>
>Sorry for coming up with this question again, but I still couldn't find any
>detailed documentation about what the entries in conf/catalina.policy
>actually do. On line 86 it says:
>
>grant {
>� // Required for JNDI lookup of named JDBC DataSource's and
>� // javamail named MimePart DataSource used to send mail
>� permission java.util.PropertyPermission "java.home", "read";
>� permission java.util.PropertyPermission "java.naming.*", "read";
>� permission java.util.PropertyPermission "javax.sql.*", "read";
>[...]
>
>As far as I understood the comments, I thought this would allow me to
>specify
>JDBC DataSources and mail sessions as Resources in my context and then make
>use of them in my servlets as described in the tomcat documentation. But I
>have to add a couple of other lines to catalina.policy to make this work:
>
>grant codeBase "file:/path/to/my/webapp/WEB-INF/classes/-" {
>� permission java.net.SocketPermission
>"mysqlserver:3306","connect,resolve";
>� permission java.util.PropertyPermission
>"javax.mail.Session.Factory","read";
>� permission java.net.SocketPermission "mysmtpserver:25","connect,resolve";
>};
>
>Is there a more elegant way to achieve the same result (e.g. without
>changing
>catalina.policy)? Any advice is very much appreciated.
>
>Best wishes
>Thomas Zumbrunn
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to