There's a trivial Jess applet "jess.ConsoleApplet" that comes with the
distribution. It is described in section 1.6.5 of the manual; you can
use it as an example to write your own, if you wish. The key
functionality is that the Rete class can accept an Applet as an
argument; so if from an applet you write

        Rete engine = new Rete(this);

and then use the "batch" command in that applet, the file will be
fetched over the web from the applet's document base, rather than from
the local file system. Other functions like "load-facts" work this way
too. The applet also uses the text widget input/output routers
(described in chapter 4 of the manual) to display the text-based
interface inside a GUI.

Now, of course, for this particular Jess program (animal.clp) there's
a problem: when the program exits, it wants to write the animal.dat
file back out. It won't be able to do that; there's generally no way
to write a file onto a web server without a program (a servlet, for
example) running there to accept the data and put it into a file. To
solve this problem, you'd need to know a reasonable amount about
developing for the web.


I think Rohan Tandel wrote:
> Dear JESS Users,
>                consider the following code:
> 
> import jess.*;
> import java.applet.*;
> import java.awt.*;
> 
> public class display
> {
>  public static void main(String args[])
>  {
>   try
>     {
>      Rete r=new Rete();
>      r.executeCommand("(batch examples/animal.clp)");
>     }
>   catch(JessException je)
>     {
>      System.err.println(je)
>     }
>   }
> }
> 
>           The above code when executed in the root
> JESS folder runs the "animal.clp" file in DOS.
>          
>            Is there any way to re-direct the output of
> the "animal.clp" file on a Java Applet? 
> 
> Eagerly waiting for your help!
> 
>                                              - Rohan
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the list
> (use your own address!) List problems? Notify [EMAIL PROTECTED]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to