Hi Ernest,

I used the path that you had suggested. Forward slash seems to be
alright. I went through the codes on part 6 briefly. Does the Tekmart
example code actually save the purchased item into this data file?
Initially I had some facts defined by deffacts but after running through
the servlet programs, the data file became blank. Am I on the right
path?

I'm still trying to get the hang on Java. Sorry if the questions sound
silly.

Btw, I'm running Jess 6.1 together with Tomcat 4.1.27 on Windows XP Pro.
- Sun JDK 1.4.2

Thanks!

Anthony


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 2:17 AM
To: [EMAIL PROTECTED]
Subject: Re: JESS: JIA - initialization parameters

I think Anthony Wong wrote:
> Hi,
> 
> Need some help here. I will be referring to the book Jess in Action in
> particular, since the notes have some details about the problem that
I'm
> about to ask. The reference can be found on page 352 where the
> context-param is used to refer to a file.
> 
> <context-param>
>         <param-name>factsfile</param-name>
>         <param-value>/var/data</param-value>
> </context-param>
> 
> 1) What's the absolute path that I should use in a Windows OS? I used
> the path c:\temp\data.dat and it returned to me an error. So I'm
> guessing if I need to use another backslash to delimit the \
character.
> (e.g c:\\temp\\data.dat) - nothing turned up in my test


I'm not especially windows savvy, but if you look at the code for the
servlet, that parameter is used like

      if (new File(factsFile).exists())
        engine.executeCommand("(load-facts \"" + factsFile + "\")");

So it's quoted (which takes care of the colon) but it will be parsed
by Jess, which means those backslashes will need to be escaped, as
you've shown, or even better, just use forward slashes (Java can
handle those just fine even in Windows paths. So

        c:/temp/data.dat

would probably work fine.

> 
> 2) can I have blank data file to begin with?

Yes. Again, look at the code above from BaseServlet.java -- the file
doesn't need to exist.

> 
> 3) if the param-value tag only consist of just the name of the file.
Is
> it defaulted to access the file from the class directory (the same as
> the tekmart.clp file)?

load-facts uses Rete.getResource(), which does all sorts of nifty
ClassLoader magic; so I believe (contingent on a possible gap in my
knowledge of how your own servlet container is set up) that yes, that
will work.




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

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