Jeromy Evans wrote:
mraible wrote:


I tried FreeMarker this morning and discovered that the problem exists there
too. Grrr. I've experienced Struts 2 being eliminated as a web framework
candidate on a couple projects because of this. Kindof annoying.

So what do you really want? My guess here is that you invoked a struts tag and the tag swallowed the error and provided a default to the freemarker template.



On further thought I think this comes down to an interesting issue with coupling between the view and the model. In struts2 the model is a ValueStack that consists of both a stack and map (context). OGNL is used to address properties or methods in that model and it's a trivial for OGNL to log when it fails to match a property or method.

In the view, Struts2 provides tags for jsp, ftl or velocity that evaluate OGNL expressions to access the model. More often that not the tags fail silently if the expression was invalid or failed to evaluate anything. Herein lies the problem. If I were using FTL directly to access the value stack, as a developer I could decide how to handle missing properties, blank properties or default values with FTL's excellent error handling. However, when I use FTL to invoke a Struts2 tag I lose that benefit as the tag implementations *transfer* properties into the FTL context. I think its a flaw that Struts2 tags evaluate OGNL expressions themselves prior to rendering the template.. A tag overhaul is well overdue (but major effort). I've expressed other concerns about the Struts2 tags (XWork Component and UIBean) on several occasions already.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to