Questions tagged [ognl]

OGNL stands for Object-Graph Navigation Language. It is an expression language for getting and setting properties of Java objects.

OGNL stands for Object-Graph Navigation Language (pronounced oganal); it is an expression language for getting and setting properties of Java objects, plus other extras such as list projection and selection and lambda expressions. You use the same expression for both getting and setting the value of a property.

The official site, gives the following uses to which OGNL has been applied:

  1. A binding language between GUI elements (textfield, combobox, etc.) to model objects. Transformations are made easier by OGNL's TypeConverter mechanism to convert values from one type to another (String to numeric types, for example)
  2. A data source language to map between table columns and a Swing TableModel;
  3. A binding language between web components and the underlying model objects;
  4. A more expressive replacement for the property-getting language used by the Apache Commons BeanUtils package or JSTL's EL (which only allow simple property navigation and rudimentary indexed properties).

It is used as an expression language in various projects:

  1. Apache Click
  2. Spring Web Flow
  3. Tapestry
  4. Struts 2.

Useful resources:

  1. Official Site
  2. Developer Guide
  3. Language Guide
622 questions
7
votes
1 answer

How to pass parameter to method call in Struts 2 OGNL

I want to use a property as a param of an object's method. returns correct value (e.g. 1) gives me correct value too. But
Roy Chan
  • 2,888
  • 6
  • 36
  • 43
7
votes
3 answers

struts2 2.3.20 ognl allowStaticMethodAccess

I updated my project to Struts2 version 2.3.20 . Now all cases in my JSPs that uses static method access do not work. ie. I already…
Panos
  • 7,227
  • 13
  • 60
  • 95
7
votes
2 answers

Advantages of OGNL usage over typical EL in Struts2

Say that I don't leverage OGNL to create my Struts2 web application and just purely uses typical el provided by Sun. What would be the downside of it? As far as I know, OGNL is a kind of expression which attempts to match the best matched value…
Daniel
  • 631
  • 10
  • 18
7
votes
3 answers

To access the index value of struts iterator in scriptlet array index

Using Struts2, I have a comma separated String of my images captions. While iterating the images to render on JSP I need to display caption along with specific images and could not get any specific tag to split caption String over delimiter and to…
user2674752
7
votes
2 answers

Dynamic s:form action

Is there a way of specifying a dynamic action attribute in the s:form tag in Struts2? I want something like the below.
Kashif Nazar
  • 20,775
  • 5
  • 29
  • 46
7
votes
3 answers

How to compare two strings using Struts2 tags and OGNL?

I am trying to compare two values : one from session and anther from iterator
Dan
  • 2,086
  • 11
  • 71
  • 137
7
votes
4 answers

How to access ValueStack objects within Struts iterator?

I have following code: " />
Monika Michael
  • 1,274
  • 5
  • 13
  • 24
6
votes
2 answers

How to apply a method to a parameter in MyBatis

After reading about Mapper XMLs I can't help to wonder how one might go about appling some common transforms to a parameter. For example...