Hi
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.create(“vault1”);
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) iter.next();
if (item.isFormField()) {
//processFormField
if("reference".equals(item.getFieldName()))
ref1= item.getName(); // This is always null
}
}
Please help.
Cheers
Gayathri