| Author |
errors.add() question
|
pradeep arum
Ranch Hand
Joined: Oct 01, 2003
Posts: 130
|
|
hi all, I want to display errors directly without writing key, value pairs in the properties file, i want to pass a string of my choice to errors.add("fatal error ") and make the <html:error> pick up the error and display on the JSP page, i know there is a way with message resource in the web.xml, but i am not sure.please help. thanks
|
SCJP1.4,SCBCD
Failure is not when you fall down; its only when you fail to get up again.
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4695
|
|
I'm not sure that can be done without extending the framework. You could always cheat and do: ApplicationResources: error.x = {0} Action: errors.add("x", new ActionError("error.x", "Don't do that again!");
|
A good workman is known by his tools.
|
 |
pradeep arum
Ranch Hand
Joined: Oct 01, 2003
Posts: 130
|
|
i thoutght of this idea before, but i dont want the properties file. thanks Pradeep
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4695
|
|
Like I said you'll have to extend the framework. One way to do it is from MessagesTag. In the doStartTag() method find this: and turn it to this: String msg = report.getKey();
|
 |
sreenath reddy
Ranch Hand
Joined: Sep 21, 2003
Posts: 415
|
|
Hi pradeep I agree with marks idea of substitution if u use properties but if u overwrite the tag as he said that will make u loose the original behaviour of errors tag so better extend as i wrote in another post
|
 |
 |
|
|
subject: errors.add() question
|
|
|