I've my Struts 2 actions as ModelDriven. I've some fields defined on the actions themselves as well. However, if in the JSP I use wrong field names that are neither in ModelDriven model nor directly used as action member fields then I don't get any errors and it simply ignores those fields.
<s:if test="(method == 'list')">
If method is neither a ModelDriven model field nor an action member field then it simply ignores this s:if statement and doesn't execute instructions inside this s:if statement.
Any idea on how to throw errors on JSP for fields that are non-mapped in the ModelDriven models fields or in the actions of ModelDriven models?
OGNL expressions can throw exceptions but they are caught internally.
However, if you know which expression returns
nullthen create abooleanexpression.The java code is encapsulated in the tags implementation. If tags cannot execute they throw 500 internal server error. You can write your custom tags to throw that errors.