File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes how we return error in javascript message box ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how we return error in javascript message box ?" Watch "how we return error in javascript message box ?" New topic

how we return error in javascript message box ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 465
hi, good day, how can we return error message in javascript message box ?
for example, when we capture the error from exception handling and save it to errors, how can we display these error in javascript message box ?

thank you
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
If you are talking about ActionError/Actionmessages set on the server side
to be disaplyed on the client side, then I don't think we can do this using javascript message box(alert box).

ActionMessages/ActionErrors are displayed on the top of the page as bullentins(we can change bulletins to be something else).
All we need in jsp is the html:message tag.

Hope this helps
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you use the Struts Validation framework to do your validation, that has the ability to do client-side validation, meaning that it will display error messages in JavaScript alert boxes.

To find out more about how to use the Struts Validation framework, see this link.

Consultant, Sima Solutions
I agree. Here's the link:
subject: how we return error in javascript message box ?
It's not a secret anymore!