RE: ActionError problem
Does this approach work for you? Make sure your messages are filled in (eng.admin.group.error.groupname.required) etc. You should have no need to play with Request, the GET/SET methods should be populated. -Alex public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); try { if (this.group_name == null) { errors.add(group_name, new ActionError(eng.admin.group.error.groupname.required)); } return errors; } catch (Exception e) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(eng.error.general,e.getMessage())); return errors; } } -Original Message- From: Bryan P. Glennon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 7:09 PM To: [EMAIL PROTECTED] Subject: ActionError problem Sorry to keep bugging this list, but you have all been so helpful... I am getting an HTTP error 500 (internal server error) sometime after the validate method in my form bean returns. I see all of my logging messages, and there is one entry in the errors list. I see no indication of problems in any of the tomcat or application logs. The validate method looks like this: public ActionErrors validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { cat.debug(Validate); ActionErrors errors = new ActionErrors(); cat.debug(errors created); Object o = request.getSession().getAttribute(currentObject); o = null; // Force error for testing... if(o == null) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.noCurrentObject)); } cat.debug(Returning error with + errors.size() + entries.); return errors; } Any ideas? Thanks, Bryan -- Bryan Glennon (mailto:[EMAIL PROTECTED]) BPG Consulting, Inc. (http://www.bpgc.com) Tech Question? (mailto:[EMAIL PROTECTED]) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionError problem
Alex- I do need to get the session object from the request, so that I can insure that an object has been set for the operation. It seems to make no difference if I use it or not - I tried just creating/populating the ActionErrors object and doing nothing else, and I got the same results... Thanks, Bryan -- Bryan Glennon (mailto:[EMAIL PROTECTED]) BPG Consulting, Inc. (http://www.bpgc.com) Tech Question? (mailto:[EMAIL PROTECTED]) -Original Message- From: Brown, Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 6:13 PM To: 'Struts Users Mailing List' Subject: RE: ActionError problem Does this approach work for you? Make sure your messages are filled in (eng.admin.group.error.groupname.required) etc. You should have no need to play with Request, the GET/SET methods should be populated. -Alex public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); try { if (this.group_name == null) { errors.add(group_name, new ActionError(eng.admin.group.error.groupname.required)); } return errors; } catch (Exception e) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(eng.error.general,e.getMessage())); return errors; } } -Original Message- From: Bryan P. Glennon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 7:09 PM To: [EMAIL PROTECTED] Subject: ActionError problem Sorry to keep bugging this list, but you have all been so helpful... I am getting an HTTP error 500 (internal server error) sometime after the validate method in my form bean returns. I see all of my logging messages, and there is one entry in the errors list. I see no indication of problems in any of the tomcat or application logs. The validate method looks like this: public ActionErrors validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { cat.debug(Validate); ActionErrors errors = new ActionErrors(); cat.debug(errors created); Object o = request.getSession().getAttribute(currentObject); o = null; // Force error for testing... if(o == null) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.noCurrentObject)); } cat.debug(Returning error with + errors.size() + entries.); return errors; } Any ideas? Thanks, Bryan -- Bryan Glennon (mailto:[EMAIL PROTECTED]) BPG Consulting, Inc. (http://www.bpgc.com) Tech Question? (mailto:[EMAIL PROTECTED]) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionError problem
Do you have error.noCurrentObject in your ApplicationResources.properties file? In your struts config, if there is a validate=true then there needs to be and input=a jsp or action to populate that jsp cheers, Phil Maher -Original Message- From: Bryan P. Glennon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 4:19 PM To: Struts Users Mailing List Subject: RE: ActionError problem Alex- I do need to get the session object from the request, so that I can insure that an object has been set for the operation. It seems to make no difference if I use it or not - I tried just creating/populating the ActionErrors object and doing nothing else, and I got the same results... Thanks, Bryan -- Bryan Glennon (mailto:[EMAIL PROTECTED]) BPG Consulting, Inc. (http://www.bpgc.com) Tech Question? (mailto:[EMAIL PROTECTED]) -Original Message- From: Brown, Alex [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 6:13 PM To: 'Struts Users Mailing List' Subject: RE: ActionError problem Does this approach work for you? Make sure your messages are filled in (eng.admin.group.error.groupname.required) etc. You should have no need to play with Request, the GET/SET methods should be populated. -Alex public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); try { if (this.group_name == null) { errors.add(group_name, new ActionError(eng.admin.group.error.groupname.required)); } return errors; } catch (Exception e) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(eng.error.general,e.getMessage())); return errors; } } -Original Message- From: Bryan P. Glennon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 7:09 PM To: [EMAIL PROTECTED] Subject: ActionError problem Sorry to keep bugging this list, but you have all been so helpful... I am getting an HTTP error 500 (internal server error) sometime after the validate method in my form bean returns. I see all of my logging messages, and there is one entry in the errors list. I see no indication of problems in any of the tomcat or application logs. The validate method looks like this: public ActionErrors validate(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { cat.debug(Validate); ActionErrors errors = new ActionErrors(); cat.debug(errors created); Object o = request.getSession().getAttribute(currentObject); o = null; // Force error for testing... if(o == null) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(error.noCurrentObject)); } cat.debug(Returning error with + errors.size() + entries.); return errors; } Any ideas? Thanks, Bryan -- Bryan Glennon (mailto:[EMAIL PROTECTED]) BPG Consulting, Inc. (http://www.bpgc.com) Tech Question? (mailto:[EMAIL PROTECTED]) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionError() problem
Title: ActionError() problem You have answered your own question :) Use a message properties file, and have the property value as something like error.lineError=error at line {0} then call new ActionError( "error.lineError", lineNo ); the {0} will be replaced with value0 (likewise {1} and {2} if you use the other constructors for ActionError) Cheers, Brett -Original Message-From: Gao, Gang [mailto:[EMAIL PROTECTED]]Sent: Thursday, 27 September 2001 9:33 AMTo: [EMAIL PROTECTED]Subject: ActionError() problem Hi, How can I use ActionError() to construct the error message that is not define in the message property file? Who can give me a example. I want display a dynamic error message such as "ith line got some error !". Who can give me a explanation about second parameter for following ActionError method public ActionError(java.lang.String key, java.lang.Object value0) Construct an action error with the specified replacement values. Parameters: key - Message key for this error message value0 - First replacement value Thanks in advance! Gang