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

Call a singleton method in OGNL Struts 2

I need to access a method of a singleton class to obtain a parameter The prototype of the call from Java code is: SosConstant.getInstance().getParameter("type"); I have a set of parameters that modify the view, so I need to access these data…
0
votes
1 answer

jsp in another jsp struts 2

1st problem : i have a jsp in which there are two tabs ,for the second tab i have included the struts include tag. When i open the second tab and performs the action the second tab form values are not passing to the action. 2nd problem : in…
Harish Gupta
  • 364
  • 2
  • 8
  • 23
0
votes
1 answer

How to get s:radio with label content as empty

I am using the struts tag s:radio as below; That is generating the HTML output as below;
Subbu
  • 41
  • 5
0
votes
1 answer

How to check List contains the particular element null or not in Struts 2 using Tags?

I have an action in Struts 2, I want to test whether email ID is empty or null using test condition in JSP. class EmailAction extends ActionSupport { private ArrayList emailList; //setter and getters } class Email { …
0
votes
1 answer

How to send a list of object from jsp to struts2 action class?

I am new to Struts2. I have a JSP page which shows a list of Rooms (where Room is a user-defined class). I need to send this entire list to the action class as a hidden field. The JSP code is as follows:
Crusaderpyro
  • 2,163
  • 5
  • 29
  • 53
0
votes
1 answer

Where should I provide the getters and setters for parameters in Struts2?

I am new to Struts2 and I just realized that whenever I call an action class via a form of a JSP page, I need to have getters and setters for all the parameters in the called action class to access the parameters as shown in below action…
Crusaderpyro
  • 2,163
  • 5
  • 29
  • 53
0
votes
2 answers

Setting a Struts2 select tag to a variable from the request object

I want to set the Struts2 select tag to a variable from the request object instead of the action class variable. My action class is: public class showSchdulesAction extends ActionSupport public String execute() throws Exception { …
Vinoth Kumar
  • 111
  • 1
  • 4
  • 8
0
votes
1 answer

Struts2 s:if test for non-null value

I am wanting to test for a non-null value using a struts2 tag. This works if I use the following: ..stuff.. It also seems to work if I miss out the not-null part, and just do:
user155631
  • 85
  • 2
  • 9
0
votes
1 answer

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

I have an object which need to be updated, the following form is used to update it. I have an attribute called createDate that I do not want to be changed when I update the record therefore I did not include it in the form, but when I submit the…
AlexCartio1
  • 238
  • 3
  • 9
  • 29
0
votes
1 answer

Struts 2 not setting action property on form submission. Unexpected Exception caught .Error setting expression with value ['1', ]

Struts 2 is giving a strange behavior that the commercial,productCategory objects is not set on on form submission.It happens in some cases like these.Other fields are getting set properly Most of the cases struts 2 is setting the custom objects…
POJO
  • 11
  • 6
0
votes
0 answers

Getting Ognl:NoConversationPossible Error

I'm Using Struts2 and JQGrid. From JQgrid, I'm Calling to Action class to return JSON data to load data for my Grid. Values are properly coming from Action class but value is not getting populate on my grid and i receives Ognl:NoConversationPossible…
user2326298
  • 1
  • 1
  • 5
0
votes
0 answers

how to validate an ognl expression

in struts 2 I want to save an ognl expression in my db and use it later to validate something. There is a way to check if that expression is formally correct? Exist a library or a regex for that?
simoneloru
  • 23
  • 4
0
votes
1 answer

Conditional checks in OGNL

I want to represent the following JSTL code in Object Graph Navigation Language (OGNL).
Tiny
  • 27,221
  • 105
  • 339
  • 599
0
votes
1 answer

Adding the condition in my jsp

Here, I am creating a jsp where I am getting the actionId from the database. Here, I want to add the condition tag and check for particular values.
struts2
  • 54
  • 1
  • 7
0
votes
1 answer

Struts2 passing data in different ways

I have been given the following code of a JSP page that uses the Struts2 framework ...
user1884155
  • 3,616
  • 4
  • 55
  • 108