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
0
votes
1 answer

Struts2 tag giving jasper exception

Below is the jsp code
0
votes
1 answer

Using OGNL inside OGNL is Struts2 tags

I have an iterator tag that creates both < s:url > and < sj:a > tags, being the former the href to be accessed by the latter. Here is the code:
Daniel Calderon Mori
  • 5,466
  • 6
  • 26
  • 36
0
votes
1 answer

Struts2 post List> back to an action

I am using struts 2.1.8 and ognl 2.7.3. On my action class, I have a field (the map's keys: 'foo', 'bar'): public class TestAction extends ActionSupport { private static Log log = LogFactory.getLog(TestAction.class); private static final long…
Matt W
  • 1
  • 2
0
votes
2 answers

What is the right way to manage data edits in struts2-hibernate?

I am using Struts2, Hibernate 3.5. I have complex object graph. So every time data is submitted in a edit mode, i need to make sure id of the all the object nodes are available in the request. So every time object are displayed on the UI, i am…
kunal
  • 779
  • 6
  • 25
0
votes
4 answers

Customize the value of struts2 textfield tag using OGNL

I have a database with a user information. When the user is logged on, I registered the user on the session as follow: ActionContext.getContext().getSession().put("loggedUser", user); And I want to get the user's information in my jsp page to fill…
SSMZ
  • 13
  • 2
  • 6
0
votes
1 answer

Wildcards in OGNL?

I had to write some OGNL to look something up in a table, sort of like using a C# dictionary. This was easy enough: #mapping=#{"XYZ":"1234","YZX":"5678"}, #mapping.get(this.A.toString()) But now my requirements have changed. Now I need to make some…
SuperNES
  • 2,760
  • 9
  • 37
  • 49
0
votes
1 answer

How to disable ognl evaluation?

To force OGNL evaluation one could use the %{} syntax, but what should be used to disable it? Consider following code - What happens is that viewItem is looked up…
Kshitiz Sharma
  • 17,947
  • 26
  • 98
  • 169
0
votes
1 answer

OGNL and wildcards working in tiles definitions with struts2-tiles-plugin?

I want Tiles to resolve ognl from the struts2 value stack. How to do this? Using tiles 2.2.2 (although if a later version such as 3 could be used that is fine) Here it mentions the new…
Quaternion
  • 10,380
  • 6
  • 51
  • 102
-1
votes
1 answer

Unable to understand OGNL expression with in operator

In the official docs: https://commons.apache.org/proper/commons-ognl/language-guide.html there is an explanation for in operator: The in operator (and not in, its negation). This is a containment test, to see if a value is in a collection. For…
Shah-G
  • 652
  • 1
  • 8
  • 22
-1
votes
1 answer

File upload not working with Struts2 Model-Driven Interface

When I am using Model driven interface, my file upload operation is not working. It is not popping any error, nor it is generating any log. My code is attached hereby, I want to know for file, do we have to generate its getters/setters in Model or…
-1
votes
2 answers

checking if a key is present in a hashmap JSP Struts 2

I have a hashmap in an action class. I am trying to check if a key is not present to display a particular text on screen. However, it is not working. below is the code:
JJN
  • 69
  • 1
  • 9
-1
votes
1 answer

pojo to hashmap with custom keys

How to convert a java pojo to hashmap( and reverse) not using field names but instead custom keys in an efficient manner. for instance; Customer: - name = aaa - surname = bbb will be converted to hashmap with keys…
cacert
  • 2,677
  • 10
  • 33
  • 56
-1
votes
1 answer

Value of list attribute of radio button from scriplet in Struts 2

I want to read a key and value of list from a loop. Below is the code snippet that I tried but it's not working. <%Integer idInt =…
sweety
  • 105
  • 1
  • 6
-1
votes
1 answer

Encountered Jsp validation issue in Struts 2

In a JSP page, Am using Struts 2 option and listed the values as mentioned in the below code.
Sabarish
  • 1,184
  • 3
  • 14
  • 35
-1
votes
1 answer

value in JavaScript giving error

I am trying to access values in my JavaScript but getting error. Here Names is a list. I tried to put in variable also but still its not converting to array. Not sure where I am going wrong .…
abhinav singh
  • 856
  • 6
  • 23
  • 45
1 2 3
41
42