Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how we return error in javascript message box ?

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Onion rings are vegetable donuts. Taste this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!