mercredi 27 mars 2019

how do i print a variable inside a servlet

i am having this problem where i have retrieved a value using the post method and i want to print that value how do i do that?

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    String comment = request.getParameter("comment");
    PrintWriter out = response.getWriter();
    int id = Integer.parseInt(request.getParameter("qid"));

    out.print(+id+);
}

/**
 * Returns a short description of the servlet.
 *




Aucun commentaire:

Enregistrer un commentaire