title: how to request getparameter for hidden input in mulitpart in servlet?
body: <p>I have hidden input type where i had stored selected id </p>
  
  <p><strong>JSP File</strong></p>
  
  <pre><code>&lt;form method="post" enctype="multipart/form-data" action="./PropertyImage"&gt;
      &lt;input type="hidden" name="property_id" value="&lt;%=bean.getproperty_id%&gt;"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>now in servlet i had to access this hidden input type </p>
  
  <p><strong>Sevlet</strong></p>
  
  <pre><code>FileItemFactory factory = new DiskFileItemFactory();
  
      // Create a new file upload handler
      ServletFileUpload upload = new ServletFileUpload( factory );
      // upload.setSizeMax(yourMaxRequestSize);
  
      // Parse the request
      List&lt;FileItem&gt; uploadItems;
  
  try
      {
          uploadItems = upload.parseRequest( request );
  
          Dictionary dict = new Hashtable();
  
          for( FileItem uploadItem : uploadItems )
          {
            if( uploadItem.isFormField() )
            {  
                String fname = "";
                String fieldName = uploadItem.getFieldName();
                String value = uploadItem.getString();
  
              dict.put(fieldName, value);
            }       
              System.out.println("Property  id == "+dict.get("property_id"));
  
          final String UPLOAD_DIRECTORY="E:/parag/project/New folder/sam/WebContent/images/agentimg";
  
          String image_name="";
          String imagepath="";
  
          if(ServletFileUpload.isMultipartContent(request))
          {
              try 
              {
                  for(FileItem item : uploadItems)
                  {
                      if(!item.isFormField())
                      {
                          //get the value for select images to upload . 
                          image_name = new File(item.getName()).getName();
  
                          System.out.println("image name == "+image_name);
                          String imagename=new Date().getTime()+image_name;
                          item.write( new File(UPLOAD_DIRECTORY + File.separator +imagename));
                          request.setAttribute("image", UPLOAD_DIRECTORY + File.separator + image_name);
  
                          //create images path to forward database.
                          imagepath="images/agentsimg/"+imagename;
  
                          System.out.println("path == "+imagepath);
                      }
                  }
  
              } 
              catch (Exception e) 
              {
                  // TODO: handle exception
                  e.printStackTrace();
              }
  
              PropertyBean bean = new PropertyBean();
  
  //              bean.setProperty_id(property_id);
              bean.setProperty_image(imagepath);
  
              int status = PropertyModel.propertyImage(bean);
  
              if(status&gt;0)
              {  
                  String message = "Image added to database";
                  request.setAttribute("message", message);
                  request.getRequestDispatcher("/properties.jsp").forward(request, response);
              }
              else
              {  
                  String message1 = "Image not added to database";
                  request.setAttribute("message1", message1);
                  request.getRequestDispatcher("/properties.jsp").forward(request, response);
              }  
  
          }
          else
          {
              String message2 = "Image upload to database";
              request.setAttribute("message2", message2);
              request.getRequestDispatcher("/agents.jsp").forward(request, response);
          }
  
      } 
      catch (Exception e)
      {
          // TODO: handle exception
          e.printStackTrace();
      }
  </code></pre>
  
  <p>but the output is</p>
  
  <blockquote>
    <p>Property id == null</p>
  </blockquote>
  
  <p>please help me this </p>
  
  <p>how to get request parameter of hidden input type while multipart??? </p>