Getting undefined message from post request

Getting undefined message from post request

Hi, I don't know the reason of getting the message as 'undefined' in alert dialog box, whenever I do the post request to servlets from jquery after clicking login button.

Here's the code which's making me bugged:

  1.  $.post("Check.do", $('#form').serialize(),
  2.    function(data){
  3.      alert(data.message); //displaying undefined
  4.     
  5.    });
  6. }

the request is passing to servlets(which is mapped to Check.do URL), and in doPost method in servlets I'm just doing:


  1. response().getWriter().write("Hello");

May I know the what's the reason of getting error in above code, and how can I sort this problem out?