Friday, March 11, 2011

Remove dot infront of actionerror and actionmessage in Struts2

You can see the dot symbol infront of actionError and actionMessages while displaying your result in jsp page.

This is because of placing <s:actionerror />  and <s:actionmessages />  directly into your jsp page.
Actionerror and Actionmessage displays result in un-ordered list format.
Your Error or Message in the following format

1) . Action Error
2) . Action Message

Inorder to remove the dot symbol place the <s:actionerror> and <s:actionmessage> inside <s:if> condition


   


   
div class="errors" and div class="messages" are not mandatory.
Both are css classes.
Dot symbol will get removed and you will get the expected result.

For more java programming click this Link.
Do post your comments

3 comments:

Sharmila said...

Thanks for the code. Unfortunately this doesn't remove the dot before the message/error. if possible pls respond back with solution.
Thanks once agian!

Dhyani Rawal said...

I used it ,Actionmessages and ActionErrors are displayed properly...
But i have got some weired behavior of hasActionErrors and hasActionMessages, its working in some pages and not working in some pages

prathap kumar said...

Great Article

Struts Online Training
Struts 2 Online Training
Struts Training in Chennai
Struts 2 Training