First: It seems wrong to tell the user that an id does not exist! It
goesd against security conventions!

Second.. I think you should do something like this:
 errors.add(Application.GLOBAL_ERRORS, new
ActionError("err.app.login.invalid",txtLoginId )); 

With your ,messageresource having a line:
err.app.login.invalid={0}, login id does not exits.

regards

-----Original Message-----
From: Khan [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 24 juni 2005 11:33
To: user@struts.apache.org
Subject: problem while displaying error message


Hi,
  Iam using Struts1.0 ActionErrors and ActionError object to
store/display 
errors which is reading the errors from ApplicationResources file. Iam 
unable to display the error for dynamically generated values. Any idea 
please.
 My Code:
----------------
 String txtLoginId = "Manager" ; // txtLoginId value comes dynamically
as 
entered by the user
 ActionErrors errors = new ActionErrors();
 errors.add(Application.GLOBAL_ERRORS, new ActionError("
err.app.login.invalid")); // This works fine. The proper error which is 
given in resources file will be shown in the html page.
  String errMsg = txtLoginId +" , login id does not exits.";
 errors.add(Application.GLOBAL_ERRORS, new ActionError(errMsg)); // This

also works fine, but how to show this errMsg value in the html file by 
<html:errors /> 
 Thanks in advance.
 Regards
Khan


-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to