How to access the form fields from JSP

This might be a very basic question. I would like to know how to get the values that are set through setFormField(name,value) in a JSP.

My code is as follows.

in JS

vault.setFormField(“reference”, ref1);
vault.setFormField(“ref2”, ref2);

in jsp

String fileId = request.getParameter(“sessionId”).toString().trim();

    // Create a new file upload handler
    FileItemFactory factory = new ProgressMonitorFileItemFactory(request, fileId);
    ServletFileUpload upload = new ServletFileUpload(factory);

    // Parse the request
    List /* FileItem */ items = upload.parseRequest(request);

    // Process the uploaded items
    Iterator iter = items.iterator();
    String ref1= "";

    while (iter.hasNext()) {
        FileItem item = (FileItem);

        if (item.isFormField()) {
                ref1= item.getName(); // This is always null

Please help.

your code is correct 90%, but it should be ref1= item.getString();