i am unable to fetch data from servlet in android app
<p>the android code is
here json is unable to fetch data from servlet</p>

<pre><code>    package com.example.prac;




public class MainActivity extends Activity implements OnClickListener{
/** Called when the activity is first created. */
TextView resultView;

  HttpClient client;
 String Dat;
 Button btn;
 EditText name,roll_no;
 String result="";
StringBuilder sb=null;
 JSONArray jArray;
 @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    resultView = (TextView) findViewById(R.id.tv1);
    btn=(Button)findViewById(R.id.btn);
    submit();
    btn.setOnClickListener(this);

   }
    public void onClick(View v){
   parse();
//method to parse       
   }
private String submit() {
     ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();
     nameValuePairs.add(new BasicNameValuePair("name", "sss"));
        //http post
        try{
             HttpClient httpclient = new DefaultHttpClient();
             HttpPost httppost = new HttpPost("http://10.0.2.2:8081/onlineres    /jsonserv");
             httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
             HttpResponse response = httpclient.execute(httppost);
             HttpEntity entity = response.getEntity();
             is = entity.getContent();
             }catch(Exception e){
                 Log.e("log_tag", "Error in http connection"+e.toString());
            }
        try{
              BufferedReader reader = new BufferedReader(new     InputStreamReader(is,"iso-8859-1"),8);
               sb = new StringBuilder();
               sb.append(reader.readLine() + "\n");

               String line="0";
               while ((line = reader.readLine()) != null) {
                              sb.append(line + "\n");
                }
                is.close();
                result=sb.toString();
                }catch(Exception e){
                      Log.e("log_tag", "Error converting result "+e.toString());
                }
    return result;
  }
    public void parse(){
    String roll,name;
    try{
          jArray  = new JSONArray(result);
          JSONObject json_data=null;
          for(int i=0;i&lt;jArray.length();i++){
                 json_data = jArray.getJSONObject(i);
                 name=json_data.getString("Name");
               //  roll =json_data.getString("Roll_no");
             }
          }
          catch(JSONException e1){
              Toast.makeText(getBaseContext(), "No Content Found" ,Toast.LENGTH_LONG).show();
          } catch (ParseException e1) {
                e1.printStackTrace();
        }
}
 }
</code></pre>

<p>here i run simple servlet in apache server to send normal name as response to the json but in json it doesnt get any data.kindly tell my  mistake
servlet code is</p>

<pre><code>            public class jsonserv extends HttpServlet {

/**
 * Processes requests for both HTTP
 * &lt;code&gt;GET&lt;/code&gt; and
 * &lt;code&gt;POST&lt;/code&gt; methods.
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
 protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    resultbean re=new resultbean();
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    String user=request.getParameter("name");


   // String name=re.getUsername();


    response.setContentType("application/json");

    JSONObject json_data = (JSONObject) JSONSerializer.toJSON( user );

    //System.out.println("El valor de json"+json.toString());
    out.println(json_data);


    try {
        /*
         * TODO output your page here. You may use following sample code.
         */
        out.println("&lt;html&gt;");
        out.println("&lt;head&gt;");
        out.println("&lt;title&gt;Servlet jsonserv&lt;/title&gt;");            
        out.println("&lt;/head&gt;");
        out.println("&lt;body&gt;");
        out.println("&lt;h1&gt;"+user+"&lt;/h1&gt;");
        out.println("&lt;/body&gt;");
        out.println("&lt;/html&gt;");
    } finally {            
        out.close();
    }
   }

    }
</code></pre>

<p>please help  in parsing json 
logcat is
    07-24 14:12:46.564: I/ActivityManager(58): Displayed activity com.example.prac/.MainActivity: 4816 ms (total 4816 ms)</p>

<pre><code>07-24 14:12:49.554: D/dalvikvm(107): GC_FOR_MALLOC freed 1529 objects / 214640 bytes in 62ms
07-24 14:12:50.394: D/dalvikvm(107): GC_EXTERNAL_ALLOC freed 1931 objects / 133048 bytes in 107ms
07-24 14:12:56.994: D/dalvikvm(107): GC_EXTERNAL_ALLOC freed 1583 objects / 64280 bytes in 105ms
07-24 14:13:01.174: D/dalvikvm(275): GC_FOR_MALLOC freed 3575 objects / 221152 bytes in 55ms
</code></pre>
