Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to display the Error Messages in .VM file

satya L June 10, 2012

Hi,

I am developing a plugin and i am extending "JiraWebActionSupport" , But how i can send the objects(list/Map) from my Action class to the .vm files and display the content of these objects in .vm files.

Actually i want to display all the error messages(captured from my Action class ) in frontend .VM file.

Can any one please suggest solution or share some sample Examples.

Thanks & Regards,

Satya.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2012
Velocity pulls the data from the $action, which is always referenced in the Velocity context:

#if ($action.hasAnyErrors()) <h4>Errors</h4> <ul> #foreach ($error in $action.getErrorMessages()) <li>$error</li> #end #foreach ($error in $action.errors) <li>$error</li> #end </ul> #end

0 votes
Adrien Ragot 2
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 11, 2016

Shall I suggest the following, to use the AUI colors:

#if ($action.hasAnyErrors())
    &lt;div class="aui-message aui-message-error"&gt;
        &lt;p class="title"&gt;$i18n.getText('common.words.errors')&lt;/p&gt;
        &lt;ul&gt;
            #foreach ($error in $action.getErrorMessages())
                &lt;li&gt;$textutils.htmlEncode(${error})&lt;/li&gt;
            #end
            #foreach ($error in $action.errors)
                &lt;li&gt;$textutils.htmlEncode(${error})&lt;/li&gt;
            #end
        &lt;/ul&gt;
    &lt;/div&gt;
#end

Example:

image2016-2-11 17:43:42.png

TAGS
AUG Leaders

Atlassian Community Events