Struts 2 OGNL Tutorial

The Object Graph Navigation Language (OGNL) is an expression language. It improves the availability of information put away in the ActionContext.

The struts framework sets the ValueStack as the root object of OGNL. Notice that activity object is pushed into the ValueStack. We can coordinate access the activity property.

  1. <s:property value="username"/>  

Here, username is the property key.

The struts framework places different items in ActionContext additionally for example map speaking to the request, session, application scopes.

To get these qualities for example not the activity property, we have to utilize # documentation. For instance to get the information from session scope, we have to utilize #session as given in the accompanying example:

  1. <s:property name="#session.username"/>  
(or on the other hand)
  1. <s:property name="#session['username']"/>  

javacodegeeks is optimized for learning.© javacodegeeks .
All Right Reserved and you agree to have read and accepted our term and condition