Actually, it says your EJB bean should not do java.io, so your bean is
violating the specs. It doesn't say that an EJB server should break or
complain on that. The RI complies with the specs, but a real EJB server
will likely contain a security policy that prevents you from doing that.
arkin
Marc-Oliver Scheele wrote:
>
> Hello;
>
> I thought the EJB 1.1 prohibited file access via java.io.*.
>
> I tested it against the sun's J2EE, because they have
> fully implemented EJB 1.1.
>
> And what a surprise:
> There are no restrictions for I/O!
>
> Here is the code I used in my bean:
>
> import javax.ejb.*;
> import java.io.*;
> public class AdderEJB implements SessionBean
> {
>
> int total;
>
> public void ejbCreate() {
> total = 0;
> }
>
> public void ejbCreate(int initial) {
> total = initial;
> }
>
> public void add(int number) {
> total += number;
> try {
> File file= new java.io.File("c:/temp/newww.txt");
> FileWriter writer = new FileWriter(file);
> writer.write("Hallo dies ist eine I/O-Operation mit EJB");
> writer.close();
> } catch (Exception exc) {
> System.out.println("Konnte nicht schreiben---- ");
> exc.printStackTrace();
> }
> }
>
> public int getTotal() {
> return total;
> }
>
> public AdderEJB() {}
> public void setSessionContext(SessionContext sc) {}
> public void ejbRemove() {}
> public void ejbActivate() {}
> public void ejbPassivate() {}
>
> } // AdderEJB
>
> Greetings
> Oliver
> Marc-Oliver Scheele
> Vorstand der Se@rchBroker AG
> ----------------------------------------
> Web1: http://www.SearchBroker.de
> Web3: http://www.MetaDir.de
> eMail: [EMAIL PROTECTED]
> Fon: 0351/433090-10
> ---------------------------------------
>
> ===========================================================================
> 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".
--
----------------------------------------------------------------------
Assaf Arkin www.exoffice.com
CTO, Exoffice Technologies, Inc. www.exolab.org
===========================================================================
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".