Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2006-03-22
Medium Priority
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 ApplicationProperties.properties

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 ApplicationProperties.properties 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

radarsh earned 200 total points
ID: 16257819
Hi yasoda,

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

<message-resources key="webitt" parameter="com.foo.messages" />

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

571 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