title: Using jQuery, Ajax to get DTO from database and print it at console?
body: <p>I want to get datas from DB and I'm currently using Spring.
  at result there is DTO and if I print it shows like com.shs.s1.coupon.CouponDTO@456bbb4f
  and these are the members of DTO and also it has getters/setters.</p>
  <pre><code>private String couponNum;
  private String id;
  private long disRate;
  private long disPrice;
  private String usage;
  </code></pre>
  <p>I want to print out couponNum, id and other things at DTO. But it keeps printing out undefined.</p>
  <pre><code>    function couponSelect() {
          $(&quot;.couponSelect&quot;).click(function(){
          let couponNum = $(this).attr(&quot;title&quot;);
          $(&quot;.modal-title&quot;).html(couponNum);
          $.get(&quot;./couponSelect?couponNum=&quot;+couponNum, function(result){
              result = result.trim();
              console.log(result);
              console.log(result.couponNum);
              console.log(result.id);
              console.log(result.disRate);
          });
      });
  }
  </code></pre>
  <p>Feel free to comment answers or ideas :)
  ALl comments would be nice.</p>