struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caine Lai" <caine...@gmail.com>
Subject How do I access Struts 2 action errors in request from Freemarker view.
Date Wed, 25 Apr 2007 04:25:59 GMT
I'm trying to figure out a way to access the Struts 2 action messages in a
Freemarker template.  I copied the following code from the Struts template
directory, into my Freemarker view, but the action errors do not show up,
which tells me I must not be using the correct variable.

[#if (actionErrors?exists && actionErrors?size > 0)]
    <ul>
    [#list actionErrors as error]
        <li><span class="errorMessage">${error}</span></li>
    [/#list]
    </ul>
[/#if]


I've also tried Request.actionErrors, but this doesn't work either.

Does anyone have an idea how I can get access to these?  I need to be able
to customize the output of these messages.  I know there is a way to
override the Struts 2 default template, but I need to combine actionErrors
and actionMessages in a single template.

Thanks for any help.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message