1 Reply Latest reply: Dec 6, 2011 2:22 AM by EJP RSS

    how to request a hidden field value on servlet with post method?

    903603
      hi,

      i am trying to get a hiddenField value on servlet but i am getting a null value, how to solve this?

      my jsp code look like this:

      <form action="ImageResizeServlet" method="post">
      <input type="hidden" id="pageWidth" name="pWidth"></input>
      </form>

      and my servlet code look like this:

      protected void processRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
      response.setContentType("text/html;charset=UTF-8");
      PrintWriter out = response.getWriter();
      try {
      String s=request.getParameter("pWidth");
      ....


      what to do?
      thank you.