0

I tried to use JEXL to evaluate the syntax but not getting through. Want your help guys to get it executed.

I want to evaluate dynamic replace statement (.replace("\u00A0","")) coming through ajax.

In Java -

removeSpecialChars = ".replace("\u00A0","");
text.replaceAll("\\p{Cntrl}", "");
text = text + removeSpecialChars;

How can we evaluate the text statement using JEXL.

Sks
  • 612
  • 7
  • 23

1 Answers1

0

You need to follow JEXL's tutorial

The easiest way of obtaining a a context is to use the new MapContext() statement. This creates a context implemented using an underlying HashMap

Expressions are created using the JexlEngine.createExpression(String) method.

Once you have your expression, you can then use use the evaluate to execute it and obtain a result.

Community
  • 1
  • 1
Ori Marko
  • 56,308
  • 23
  • 131
  • 233