Back to the original question though. It is perfectly legal to do
objabc.getClass().getResource("xxx"); which all that's need to read a property
resource or for localization.Reading and writing files is not restricted per say. The use of java.io is restricted. However, it's perfectly possible to use a jdbc driver to other resource adapter to read and write files. There's been extensive discussion of this in the archives. --Victor John Harby wrote: > Not ok with the spec, section 24.1 states: > > "� The enterprise bean must not attempt to create a class loader; obtain the > current class loader;set the context class loader; set security manager; > create a new security manager; stop the JVM; or change the input, output, > and error streams. > > These functions are reserved for the EJB Container. Allowing the enterprise > bean to use these functions could compromise security and decrease the > Container�s ability to properly manage the runtime environment." > > I think the issue you'll find is that runtime security exceptions can occur > when the loader is created/obtained. If the developer is doing this sort of > thing then the container cannot intercept these exceptions so the container > is no longer in control of the application. > > >From: Johan Eltes <[EMAIL PROTECTED]> > >Reply-To: [EMAIL PROTECTED] > >To: [EMAIL PROTECTED] > >Subject: Using classloader to load files from EJB jar (was: "Environment > > Variables") > >Date: Fri, 28 Sep 2001 10:42:01 +0200 > > > >I should be ok to load files in the EJB Jar through the class loader, > >shouldn't it? > >Otherwise it would be hard to do localization and other tasks that are > >supported by property-files and other representations of localized > >resources? > >My interpretation of the file io restriction stated in the spec, is that > >you > >shouldn't do file io by referencing the file system. > >This has been on the agenda in many threads.... > > > >/Johan > > ------------------------------------------------- "I've figured out the difference between scientific knowledge and business knowledge. Scientific knowledge depends on facts, logic, and the rigorous testing of ideas in the laboratory and the field. Business knowledge depends on the assertion of pet biases with great confidence and exorbitant billing rates." --Bob Lewis =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
