OGNL introduction
OGNL is the Object Graph Navigation Language which is an opensource framework from Apache Commons project and is used in setting and getting properties from the Java Beans.
OGNL also enables to invoke the methods from the Java classes.
OGNL was primarily designed to use with the UI forms to set the form values to the Java Beans.
OGNL was integrated to struts 2 when the Webworks framework was integrated and a lot of hardwork was put to bring in the OGNL into the Struts 2 to make it simple to use for the developers.
OGNL also enables to invoke the methods from the Java classes.
OGNL was primarily designed to use with the UI forms to set the form values to the Java Beans.
OGNL was integrated to struts 2 when the Webworks framework was integrated and a lot of hardwork was put to bring in the OGNL into the Struts 2 to make it simple to use for the developers.
Role of OGNL in Struts 2
OGNL helps in three areas in Struts 2 during the request handling process.- OGNL offers the expression language which can be used in the forms and response pages.
- OGNL helps in the type conversion during setting the form values to the Java beans types.
- Helps in looking for objects in ValueStack.