Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Erros in Struts

 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have been reading abt using error management in struts.The ActionError object needs a mandatory key for the constructor.
This can be used only when i have resource bundles for an internationalized application.What if application need not be internationalized and doesnot have resource bundles for me to refer keys?How do i use the ActionError class to display errors?
Also what is the use of adding the attribute name of the actionForm as the property name for action errors class?
Ex.ActionErrors ae=new ActionErrors();
ae.add("inputVariable",new ActionError("xxx"));( here inputVariable is the property of the formBean that created the error)
Can I use any value for the first parameter of the add method?
Hope my queries are clear.
Thanks in advance.
William
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have a .properties file even if it is not an international app.
The first parameter can be named anything. It is only used when you specify on the tags in your jsps that you only want to display errors/messages of a certain type.
 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc for the clarification
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic