Attribute and Text Interpolation

{#Constants.COMPLETE_NAME} allows to use {##expr} to replace the value of the Java expression expr within attribute values and text nodes.

For expression interpolation in text nodes the difference is to the usual xsp:expr syntax is minor. For dynamic attribute values, however, interpolation keeps it much more concise and readable.

        
          String world = "world";
          String color = "red";
        
        ]]>
      
String world = "world"; String color = "red";

Just compare this:

Hello simple {#world}!]]>
      
Hello simple {#world}!

to that:

color:colorHello complex world!]]>
      
color:colorHello complex world!

Interpolation can also be used in logicsheets:

The XSP expression parser understands nested braces, single and double quoted strings, and backslash-escaped quotes and apostrophes.

Expression Result Expected
{#new String[]{}.length} {#new String[]{}.length} 0
{#new String[]{"}"}.length} {#new String[]{"}"}.length} 1
{#"'\"}".indexOf('}')} {#"'\"}".indexOf('}')} 2