[rules-users] jsp, java and drl file

Michael Anstis michael.anstis at gmail.com
Thu Jun 14 12:17:16 EDT 2012


You need your rule to return something to Java showing the validation
result.

In your RHS you need to either:-

(a) set a global variable with the result and retrieve the value of the
global from Java after fireAllRules().

(b) insert an arbitrary fact type and have a query return this.

Both approaches should do as you need - but be warned, creating a
KnowledgeBase for each login attempt should be discouraged as it is an
expensive operation.

Most people might have a single KnowledgeBase pre-loaded into an
Application scope parameter and just create new stateless sessions in an
HTTP request.

With kind regards,

Mike

On 14 June 2012 15:39, Brajesh <brajesh4etc at gmail.com> wrote:

> Hi
>
> I am trying to say that as in my drl file if username is null or blank I
> want to show a message in my jsp page that username can't be null.
>
> Regards
> Brajesh
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/jsp-java-and-drl-file-tp4017955p4017964.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120614/2a7adc61/attachment.html 


More information about the rules-users mailing list