wood burning stoves 2.0*
The moose likes Struts and the fly likes saveErrors is deprecated Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "saveErrors is deprecated" Watch "saveErrors is deprecated" New topic
Author

saveErrors is deprecated

ramandeep singh
Greenhorn

Joined: Jan 16, 2007
Posts: 13
is there any other way to save errors on action file code is some thing like as follows

SubmitResumeStrutsAction.java


dataSource = getDataSource(request);
conn = dataSource.getConnection();
stmt = conn.createStatement();
request.setAttribute("string",strQry.toString());
stmt.executeUpdate(strQry.toString());
}catch(java.sql.SQLException sql) {
ActionErrors errors = new ActionErrors();
errors.add("sqlError",new ActionMessage("errors.SQL",sql));

// Report any errors we have discovered
if ( !errors.isEmpty() ) {

saveErrors(request, errors);
}
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
did you try to read the javadoc?


[ January 18, 2007: Message edited by: Jan Groth ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Thanks, Jan for pointing this out. This is confusing to a lot of people. Neither the ActionErrors class nor the saveErrors method of the Action class is deprecated in any version of Struts 1.

Furthermore, since ActionErrors is a subclass of ActionMessages, you can still pass an instance of ActionErrors to the saveMessages method and it will work just fine. It's just that now you have the choice of using either ActionMessages or ActionErrors when creating error messages in your action class.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: saveErrors is deprecated