Hi Scott: All you have to do is:
YouAction{ public String your_execute_method() { If(some error){ / * Chose what is appropriate for you - Field errors display the message on top of the field on HTML page*/ this.addActionError(); this.addActionMessage() this.addFieldError(); return INPUT ; /* or ERROR */ and display the same .jsp on the struts .xml file } } Please let me know if you still need more clarification/ help. -- Sincerely, Harring Figueiredo Sr. Software Engineer Email: [EMAIL PROTECTED] "We never become truly spiritual by sitting down and wishing to become so. You must undertake something so great that you cannot accomplish it unaided." On 4/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I have a situation where an attempt could be made to enter a description for an item that already exists in the database. I am using Hibernate and suspect the easiest way to prevent this is to use HQL prior to my save. Beyond this, how do I get an S2 action class to display a message on the web page? My action extends ActionSupport so I see a few methods here that look interesting: getFieldErrors() getActionErrors() getActionMessages() getErrorMessages() However, I can't tell what I need to add to these Collections as in one case it wants the name of the field in error. This too is unknown since the name I give a screen field is not what the name ultimately becomes once rendered. It appears the S2 tag expands the name of the field. I also see a ValidationAware interface that can be implemented. I would be happy to read about the technique if someone could point me in the right direction. I cannot seem to find anything on the S2 site when I need it. Is there a search facility somewhere? I would probably post far fewer questions if the available docs were search-able. Also, is there a way to search through the messages from this forum? I am starting to wonder how many of us have personal collections of email messages storing up so we can get back to that useful tip someone shared three weeks ago Tuesday! Does this not work like a NewsGroup? -- Scott [EMAIL PROTECTED]