Skip to Content
0
Former Member
May 28, 2008 at 12:23 PM

Use of the Message Framework to display error messages in JSPs

24 Views

Hi experts.

I have to display error messages in custom jsp page. I haven't found documentation on this even in the devAndExt SAP Guide, so I tried to understand the mechanism, by reading the pwchange.inc.jsp page and pwchangeAction class, which displays an info message "Enter a new password" after login in b2b with an obsolete password we have to change.

My custom jsp contains a form and the action class targeted calls a FM in CRM, which raises exceptions, catched by my backend class, and returned to my action class as string into return value of the method.

In the action class, after the call of the method I parse the return value and use :

user.addMessage(new Message(Message.ERROR,"my.message.error1",null,""));

to set the appropriate error message. Perhaps am I already wrong, but I tried to do like in the performPwChange action (useractions class).

But I don't understand how to get this error message into my custom jsp (on which we are forwarded by dispatcher if the action class returns the "error" forward) and how to display it as a standard formatted div containing message.

Please tell me how to do that, or give me some links to documentations ...

thank you for your help

Best regards

J.L.