• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

addActionError in struts2

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i am using addActionError("invalid user or paasowrd")in a action
class to display error message on a jsp page with <s:actionerror/>
on jsp page.
the message displays on jsp page on error starting with a DOT (.)
like ----> .invalid user or paasowrd
is it any way to remove this DOT (.) before the error message
(invalid user or paasowrd).

please, anyone tell me how this can be done?
Thanks in advance.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you don't mind bypassing <s:actionerror/>, you can manually iterate through the errors and format them any way you like:

<s:if test="hasActionErrors()">
<div id="errorDiv" style="padding-left: 10px; margin-bottom: 5px">
<span class="error">
<s:iterator value="actionErrors">
<span class="errorMessage"><s roperty escape="false" /></span>
</s:iterator>
</span>
</div>
</s:if>
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes Jeremy, this works

with more simple lines as below :

<div class="ErrorText">
<@s.iterator value="actionErrors">
<span><@s.property escape="false" /></span>
</@s.iterator>
</div>

Thanks gyanendra ojha and Jeremy Conner.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should Use Code Tags when you post a source code. This makes the code look good, easy to read and there won't be any emoticons in your code . You can edit your message using button and then add code tags to it...
reply
    Bookmark Topic Watch Topic
  • New Topic