Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

OGNL with Struts2

 
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Brown,
I have been using standard JSTL EL in my projects and since Struts 2 uses OGNL which apparently is a more powerful and flexible language than JSTL EL, would you suggest moving away from EL and start using OGNL ? How much of an effort would it be to migrate from EL to OGNL expression syntax? Does the book cover this aspect?

Regards,
Reghu
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you please elaborate what it is "OGNL", i am listening first time this.
 
Reghu Ram Thanumalayan
Ranch Hand
Posts: 193
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OGNL is the Object Graph Notation Language which according to the Struts 1 vs Struts 2 comparison page, is a more powerful and flexible expression language than JSTL EL.
 
Author
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OGNL is the expression language and "glue technology" used in Struts 2. Mostly you can think of it as the EL that you use from your tags to reference data properties on objects in the Struts 2 framework. It is true that OGNL is very powerful, but its role as a EL is little different than what you are already familiar with. It would be quite easy to use if you have used JSTL.

I personally think you shoudl avoid the power tools of OGNL as they usually mean that you are bringing too much logic into your view pages, but that's up to you
 
author
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, I'd like to point out it isn't an either/or decision with OGNL and JSP EL. For example, the Struts 2 tags don't allow JSP EL within their attributes, for security reasons, so you are only allowed to use OGNL expressions there. As Chad pointed out, OGNL is very powerful, but unfortunately, at least in my opinion, JSP EL is the opposite - not powerful enough. One of the features under discussion in the Struts dev list is how to resolve this by perhaps extending the JSP EL, then using it over OGNL, but again, that is only in the very early discussion phase and may or may not ever happen.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Reghu Ram T",
Please check your private messages regarding an important administrative matter.
-Ben
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic