html:errors is not working in struts to display error message

Posted on 2006-03-22
Last Modified: 2008-01-09
Hi Experts,

I am having a problem in displaying error message in jsp, I need to display error message in JSP using <html:errors/> please suggest me,

Code at ActionForm:

if(totaltenderAwdAmtSGD.compareTo(finLimitAmt) > 0)
ActionErrors actionErrors=new ActionErrors();
actionErrors.add(ActionErrors.GLOBAL_ERROR,new ActionError("error.tender.finAmt.chk.msg"));
Log.out.debug(" finLimitAmtfinLimitAmt 0000: "+actionErrors.isEmpty());

if (!actionErrors.isEmpty()) {
Log.out.debug(" finLimitAmtfinLimitAmt 1111: "+finLimitAmt);


Log.out.debug(" finLimitAmtfinLimitAmt 2222: "+finLimitAmt);
strForward = "awardConfirmItem";


Am getting all the prints,

entry at

error.tender.finAmt.chk.msg=<li>You may want to reduce the Total Awarded Amount as it exceeds selected Approving/ Verifyin Officer financial limit of approval.</li>

and at JSP

<td><html:errors bundle="webitt"/></td></tr>

webitt is the folder where is placed. I tried using and without using validate() method in ActionForm, where am returning actionErrors, Still am unable to get error message, please suggest me on this.
Question by:yasoda
    1 Comment
    LVL 10

    Accepted Solution

    Hi yasoda,

    bundle="webitt" does not mean that your be present in the folder you give.
    It refers to the key attribute you give in struts-config.xml.

    <message-resources key="webitt" parameter="" />

    Make sure you have some arrangement like the above.
    The above means that you have to put your properties file in com/foo/messages folder under classes.


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now