Short answer: Yes, you can use JSP EL instead of OGNL. Both languages ββhave their pros and cons, but there is no obvious drawback to use.
Long answer: OGNL is used internally by XWork and Struts2, so you canβt actually remove the dependency itself, however you can use JSP EL primarily (or even exclusively) in your JSP presentation level.
There are pros and cons to using an expression language. One area that OGNL shines on JSP EL is the dynamic creation of maps and collections, for example, to support <select/> elements, etc.
However, in most cases, I find that JSP EL is better for me, as I heavily use simple JSP tags ( .tag ).
@Amit Sharma: I have to disagree that using JSP / JSTL over OGNL and Struts tags strikes the purpose of using Struts2. Interceptor structure, type conversion, and result types are some of the most extensible and compelling reasons to use Struts2. None of these things are related to any particular viewing technology.
Steven benitez
source share