DFIVE
DFIVE

Reputation: 263

What does %{ } mean?

I'm new to some Java technologies; I'm trying to use a combination of struts, hibernate, and jQuery. I'm trying to figure out what does the %{} means in the following line of code:

<s:set name="tableModel" value="%{tableModel}" />

Upvotes: 2

Views: 1048

Answers (2)

jeha
jeha

Reputation: 10730

%{expression} is a OGNL escape sequence, that signals to the framework when to process the expression as an expression rather than interpreting it as a string literal.

%{tableModel} pulls the corresponding value from the OGNL ValueStack, which "normally" results in calling a getTableModel() function of your current action (depending on what's on the ValueStack).

Upvotes: 2

Ian Dallas
Ian Dallas

Reputation: 12741

At CodeRanch this questions was asked. According to Sonny Gill there:

%{} syntax is used to force OGNL evaluation where Struts would otherwise be treating the value as a String literal.

Other Resources: Apache Struts OGNL Documentation

Upvotes: 4

Related Questions