You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Long <ja...@supernovasoftware.com> on 2003/03/13 03:34:57 UTC
RE: Custom action error messages -- Solution
Create action error as follows:
ActionError(String key, Object value0, Object value1, Object value2, Object
value3)
Add error as follows message as follows:
error.price.float=<li>value0={0} value1={1} value2={2} value3={3}</li>
This can also be used with an array of strings.
Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS Chemical Engineering
-----Original Message-----
From: Jason Long [mailto:jason@supernovasoftware.com]
Sent: Wednesday, March 12, 2003 5:19 PM
To: Struts Users Mailing List
Subject: Custom action error messages
What I am looking for is something like the following:
Given error message in properties file
error.price.float=<li>Price on Item ???? must be a number greater that
0</li>
I would like to be able to display error messages with certain replaced
values.
So error could read "<li>Price on Item 6732 must be a number greater that
0</li>"
Is there a way to pass in parameter to an error message so it can give more
specific info by doing a replacement.
Maybe something like a java prepared statement.
I tried to just construct this by just sending a string in, but it wants to
look up the message in properties file.
I will appreciate any advice,
Jason Long - CEO and Chief Software Engineer
Supernova Software - supernovasoftware.com
BS Physics, MS Chemical Engineering
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org