java - what is the best way to pass messages from server to html (GUI) -


i using java , jsp develop web application.

there many situations in user input cause exception on server side, in situation user expects error message shown. there several ways (as programmer) can handle transfer of error message server gui(html) , maybe redirect other pages , show message there. 1 way go using session attribute, other can ajax method calls , showing response text. there may other ways don't know. tell me straight forward , standard way (if there standard this)?


the problem made me think when trying show response of ajax call in colorbox, , failed, appreciated if give me hint on too, how can pass response text of ajax method in other web page.

a way pass messages server html write them in html. html generated server.

there other possibilities well, such using query params, cookies, ajax calls etc, if have no special requirements should write message in output html.

within server implementation use request attributes, example. that's communication within server application, not between ui , server.

these kind of messages should either a) in response post request, have redirected error page relevant info in error page url, making page cacheable or b) direct response request parameters in request, same params result in same output.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -