You're right, I haven't heard of anyone using Jess with JSPs before
(which doesn't mean noone has, just that they haven't asked for help.)
As JSPs are really just a way of writing servlets, and Jess has been
used many times in a servlet environment, I wouldn't expect you'd have
any trouble.
In any case, the classpath problem you're having is probably just a
minor, although frustrating, issue. Jess is using Class.forName() to
get the Class object for CaseVariables. It's therefore the ClassLoader
that loads Jess that has to load the CaseVariables class, which isn't
necessarily the same one that loads your JSP's classes. If the Jess
class are somewhere else, then the CaseVariables class needs to be
there too.
Otherwise, is CaseVariables defined in a package? If so, the defclass
statement should use the fully qualified name.
I think Scott Duguid wrote:
> Hello all
>
> I am trying to build a rule-based system using JSP's and am having trouble
> finding the right structure to do this successfully. Are there many people
> who have tried to use Jess with JSP's that can help? I am having trouble
> using JSP, beans and Jess together. I have previously successfully used
> applets and Jess together but am looking to use a more dynamic, server-side
> approach.
>
> At the moment I have a series of JSP's all of which use a bean (using the
> jsp:useBean tag) called CaseVariables (name on page is cv). In the
> cv bean, I have a Rete engine (called rete) with which I can do some
> actions, but not others. Executing commands from the JSP, I get responses
> for some commands, such as (reset) or (facts) or (assert( ))
> for example. However, the following code
>
> cv.getRete().executeCommand("(defclass cv CaseVariables)");
>
> results in getting an error message, Class Not Found. I am using Tomcat, and
> have the CaseVariables.class file in the tomcat/webapps/foldername folder,
> as well as in the tomcat/webapps/foldername/WEB-INF/classes folder.
>
> I have two queries:
>
> 1) Is there anything obviously wrong with the above code?
>
> 2) Is my general approach to integrating JSP's and Jess sound?
>
> I would appreciate any help regarding these issues. There doesn't seem to
> have been much correspondence on JSP's and Jess on the mailing list archive.
>
> Regards
>
> Scott Duguid
>
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------