You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-dev@jakarta.apache.org by Olivier Dameron <ol...@gmx.net> on 2004/09/14 02:22:40 UTC

Setting the output stream of BSFManager

Dear BSF developers,
   I used to execute a script through BSF by calling the
BSFManager::exec(...) function.
   The output of the script goes to System.out, and I would like to redirect
it so that it is written in the text pane where I write my scripts. It would
be something similar to the bsh's Console, but using BSF instead of the
interpreter.

   Is there any way to set the default output ?
I don't see any BSFManager::setOut(PrintStream) nor any
BSFEngine::setOut(...), but maybe there is another solution ?

Thank you for your help
Olivier

-- 
NEU: Bis zu 10 GB Speicher f�r e-mails & Dateien!
1 GB bereits bei GMX FreeMail http://www.gmx.net/de/go/mail


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


Re: Setting the output stream of BSFManager

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Olivier Dameron wrote:

>Dear BSF developers,
>   I used to execute a script through BSF by calling the
>BSFManager::exec(...) function.
>   The output of the script goes to System.out, and I would like to redirect
>it so that it is written in the text pane where I write my scripts. It would
>be something similar to the bsh's Console, but using BSF instead of the
>interpreter.
>
>   Is there any way to set the default output ?
>I don't see any BSFManager::setOut(PrintStream) nor any
>BSFEngine::setOut(...), but maybe there is another solution ?
>  
>
You could save a reference to the text-pane as a bean in the BSFRegistry 
and address that from your script.

Hope that helps,

---rony

---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org