I'm using an applet (http://www.jumploader.com) to upload files. Normally I
would use a servlet to parse the data with apache commons fileupload. With
Wicket I trying to parse the data in the onSubmit method of the Form with no
luck.
HttpServletRequest request = ((ServletWebRequest)
getRequest()).getHttpServletRequest();
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (isMultipart) {
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = upload.parseRequest(request);
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
if (item.isFormField()) {
System.out.println(item.getFieldName() + " " +
item.getString());
} else { // process a file
String fileName = item.getName();
}
"List items = upload.parseRequest(request); " returns an empty list.
Am I doing something wrong in my code? Is this the correct approach? I
also saw the example of how to make a Wicket session available to a
non-wicket servlet.
http://wicket.sourceforge.net/apidocs/wicket/protocol/http/servlet/WicketSessionFilter.html
Is that the way to do it? I'm using 1.3.5.
Thanks in advance.
--
View this message in context:
http://www.nabble.com/Getting-data-from-applet-tp21686123p21686123.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]