Re: Getting data from applet

2009-01-29 Thread rmattler

You are correct the applet was not doing a form submit.  The servlet works.
Thanks.


igor.vaynberg wrote:
 
 the question is: how does the uploader send the upload? does it send
 the data as part of the form submit or in the background independently
 of the form data? since it can do things like pause/resume i am going
 to assume the latter which is why you are not seeing that data as part
 of the form submit. you still need that other servlet to receive the
 data. if my assumptions are incorrect feel free to create a quickstart
 so that we may investigate further.
 
 -igor
 
 On Tue, Jan 27, 2009 at 8:17 AM, rmattler robertmatt...@gmail.com wrote:

 List items = upload.parseRequest(request);

 items is still empty




 try form.setmultipart(true)

 -igor


 --
 View this message in context:
 http://www.nabble.com/Getting-data-from-applet-tp21686123p21688568.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org


 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Getting-data-from-applet-tp21686123p21727416.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Getting data from applet

2009-01-27 Thread rmattler

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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Getting data from applet

2009-01-27 Thread Igor Vaynberg
try form.setmultipart(true)

-igor

On Tue, Jan 27, 2009 at 6:15 AM, rmattler robertmatt...@gmail.com wrote:

 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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Getting data from applet

2009-01-27 Thread rmattler

List items = upload.parseRequest(request); 

items is still empty




try form.setmultipart(true)

-igor


-- 
View this message in context: 
http://www.nabble.com/Getting-data-from-applet-tp21686123p21688568.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Getting data from applet

2009-01-27 Thread Igor Vaynberg
the question is: how does the uploader send the upload? does it send
the data as part of the form submit or in the background independently
of the form data? since it can do things like pause/resume i am going
to assume the latter which is why you are not seeing that data as part
of the form submit. you still need that other servlet to receive the
data. if my assumptions are incorrect feel free to create a quickstart
so that we may investigate further.

-igor

On Tue, Jan 27, 2009 at 8:17 AM, rmattler robertmatt...@gmail.com wrote:

 List items = upload.parseRequest(request);

 items is still empty




 try form.setmultipart(true)

 -igor


 --
 View this message in context: 
 http://www.nabble.com/Getting-data-from-applet-tp21686123p21688568.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Getting data from applet

2009-01-27 Thread Ryan Gravener
Here is how I accept files from my flex applications:
http://pastie.org/372242 java

http://pastie.org/372243 html