Hi everyone,

I am trying to write an application using java and
jess.  The application will be deployed to J2EE
Application Server.  The J2EE version is
j2eesdk1.4_beta2 and Jess version is 6.0. 

I create a servlet, which resides in \src directory. 
I then copied  \jess directory to \src. There were no
problems in compiling and deploying the servlet. 
However when I try to view the servlet through web
browser I got HTTP Status 500 error.

The following is the testing code.  I first initiated
the servlet by load in the .clp file and then assert
the user input to trigger the rule in the knowledge
base.  Please help to identify the problem.

import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import jess.*;

public class ResponseServlet extends HttpServlet {
        private Rete rete=new Rete();
        private Jesp jesp;
        private FileReader freader;

        public void init() throws ServletException{

        try{
                        freader=new FileReader("c:/is.clp");
                        }
                        catch(FileNotFoundException
fe){System.out.println("error1");};
                        if(freader!=null){
                                jesp=new Jesp(freader, rete);
                        try{
                                        jesp.parse(false);
                                }catch (Exception
e){System.out.println(e.toString());};
                        }
        }//end of init()


    public void doGet (HttpServletRequest request,
                       HttpServletResponse response)
    throws ServletException, IOException
    {

     String userinput =
request.getParameter("userinput");
    if ( userinput != null && userinput.length() > 0 )
       
rete.executeCommand("(assert("+userinput+"))");
                        rete.run();

    }

 }



__________________________________
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]
--------------------------------------------------------------------

Reply via email to