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
0 answers

FileUploadInterceptor - Special characters

I hope you are fine. I'm looking for help with FileUploadInterceptor from struts2. I'm working with an application, that is uploading a pdf file trough uploadify, then it goes to the struts2 FileUploadInterceptor and after that it gets to the…
0
votes
1 answer

Struts2 get value from interceptor onto the valuestack to use in redirect result

I have the following action in my struts.xml file: test/success.jsp test/blocked.jsp
user1884155
  • 3,616
  • 4
  • 55
  • 108
0
votes
0 answers

OGNL syntax for indexed inner class

What is the OGNL syntax for accessing an indexed list where the contents of the list is an inner class. Google gives a couple of examples but these are related to accessing static members of an inner class or ENUMS. My action class public class…
user497087
  • 1,561
  • 3
  • 24
  • 41
0
votes
1 answer

JSP Struts parameter isn't showing

I have below code, testresultlists is a list transferred to JSP, and id is named as row. The problem is I can't get each row's resultTypeId during select iterator. In this I tried many ways,…
He Su
  • 15
  • 1
  • 4
0
votes
1 answer

Thymeleaf OGNL To display HttpSession variables

It is pretty easy to access individual session variables by name in OGNL / Thymeleaf for display. The session variables however is a getAttributeNames() : Enumeration while the getValueNames() is deprecated (implying that I do not want to use the…
user1210708
  • 513
  • 4
  • 11
0
votes
1 answer

How does Struts create an action bean?

I use Struts2.x and I know that Struts creates the declared bean objects in the action based on the request so that it is available to the action. I have been researching to understand which interceptors/classes does Struts use internally to create…
Manny
  • 3
  • 3
0
votes
0 answers

select radio button from database value

I am trying to select radio button from database value I am trying value="%{userInfoSettings[0].value}" which is not selecting any radio box. While iterating userInfoSettings it is showing the proper value.
xrcwrn
  • 5,339
  • 17
  • 68
  • 129
0
votes
1 answer

open jsp with disabled mode

I have a form which the user fills with its details & the same form is visible to the admin in the disable mode. Also there are few fields the admin can edit according to its role. So basically in the admin mode there are two buttons to UPDATE &…
Pradnya
  • 649
  • 2
  • 6
  • 17
0
votes
0 answers

ognl array values as GET parameters

I have an application using struts2-ognl. I have an array of strings and it gets populated by GET parameters in the request. Like the following example http://localhost:8080/myapp/myAction.action?myArray[1]=value1&myArray[2]=value2 etc etc Is there…
Panos
  • 7,227
  • 13
  • 60
  • 95
0
votes
2 answers

Compare Long values Struts2

Hi everyone I'm trying to compare two values using struts2 s:if tag but its not working. If I hardcode the values it works but I want it to be dynamic. The variable stringValue is of type String. The variable currentLongValue is of type Long.
Marquinio
  • 3
  • 1
  • 2
0
votes
1 answer

How to access multiple action properties in Strtus2 OGNL expression?

In my jsp I have this code: This should access the properties of the action and show the result of the calculation. Unfortunately, this always equals to 1 regardless of the real values…
BetaRide
  • 16,207
  • 29
  • 99
  • 177
0
votes
1 answer

Is it safe to handle session with Struts2 Tags

Im using some Struts2 tags and OGNL to validate what would be displayed into a
tag //SHOW SOMETHING RELATED WITH ADMINS //SOMETHING RELATED WITH NORMAL USERS …
Tee_Shady
  • 85
  • 8
0
votes
1 answer

ognl.MethodFailedException: Method failed for object [java.lang.NoSuchMethodException:([Ljava.lang.String;)]

I have a userCreateDate Field, When I Add the data for the first time, it gets inserted into resp. table,but when I try to update the same record by onClick of Javascript and setting the value to the respective textfields, it gives Invalid field…
Shubhankar
  • 87
  • 3
  • 6
  • 16
0
votes
1 answer

Can Struts 2 handle isValid() methods instead of getValid()

In the Struts2 framework, when I call this code in the JSP: if(test='item.value > 0') It will execute the following Java code: getItem().getValue() > 0 Does this framework also allow support for boolean attributes? Instead of a get() method, they…
user1884155
  • 3,616
  • 4
  • 55
  • 108