title: How can i pass to jsp server using volley and return a json response
body: <p>I am trying to get JSON response form JSP server using Volley.The connection is made without any problem, but the server didn't get the data that have been sent. ie,</p>
  
  <pre><code>request.getParameter(UID) returns null.
  </code></pre>
  
  <p>Billow is the code I used.. please check it.</p>
  
  <pre><code>StringRequest stringRequest=new StringRequest(Request.Method.GET,url,new Response.Listener&lt;String&gt;() {
          @Override
          public void onResponse(String s) {
              try {
  
                  Toast.makeText(getApplicationContext(),s+"",Toast.LENGTH_LONG).show();
  
              }catch (Exception e)
              {
                  Toast.makeText(getApplicationContext(),e+"",Toast.LENGTH_LONG).show();
              }
          }
      },new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError volleyError) {
  
          }
      }){
  
          @Override
          protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
              Map&lt;String,String&gt; map=new HashMap&lt;&gt;();
              map.put("UID",id);
              return map;
  
          }
      };
  
      requestQueue= Volley.newRequestQueue(this);
      requestQueue.add(stringRequest);
  </code></pre>
  
  <p>JSP</p>
  
  <pre><code>String sql="SELECT bus.Type,booking.Date,timing.Time,timing.Start,timing.Route,timing.End,bus.Regno FROM timing INNER JOIN bus on timing.Bus=bus.Id INNER JOIN booking on booking.Tid=timing.Id and booking.Status=1 AND booking.Uid='"+request.getParameter("UID")+"'";        
          System.out.println(sql);
          ResultSet rs= new Database().QueryExicute(sql);
          JSONArray array=new JSONArray();
          while(rs.next())
          {
  
              JSONObject jSONObject=new JSONObject();
              jSONObject.put("BusType",rs.getString(1));
              jSONObject.put("BookingDate",rs.getString(2));
              jSONObject.put("Time",rs.getString(3));
              jSONObject.put("Depot",rs.getString(4));
              jSONObject.put("End",rs.getString(5));  
              jSONObject.put("Start",rs.getString(6));
              jSONObject.put("reg",rs.getString(7));
              array.put(jSONObject);
          }
          PrintWriter printWriter=response.getWriter();
          printWriter.print(array);
  </code></pre>