Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Lukasz Lenart
2011/1/19 Burton Rhodes : > Thanks for all the help.  I ended up "solving" the issue with a "if > (file.exist())" check. > > However, in case anyone cares to dive into this, I've attached a very > simple Struts2/Maven app that demonstrates the problem.  After trying > to debug the root cause, I thi

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Maurizio Cucchiara
You're both right, it is not necessary java fault (I remembered an old java issue with File.renameTo). Anyway, the validation's trick should make it work. 2011/1/18 Burton Rhodes : > Struts file uploader actually gives me the fileName and contentType of > the file via the form! There just no file

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Burton Rhodes
Struts file uploader actually gives me the fileName and contentType of the file via the form! There just no file in the work directory. In my opinion that is a bug. On Tue, Jan 18, 2011 at 3:46 PM, Burton Rhodes wrote: > Well that line actually only gets an error because the file > (empty.txt) ne

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Burton Rhodes
Well that line actually only gets an error because the file (empty.txt) never gets uploaded to the "work" directory. My hunch was that the Struts FileUploadInterceptor was not copying the file over if the length of the file was "0". So the exception is caused because the file simply doesn't exist

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Dave Newton
Or commons-fileupload even? Or a mix between all of them... or... Dave On Tue, Jan 18, 2011 at 4:36 PM, Paul Benedict wrote: > Burton, > > I don't know if this is an issue with Struts or the servlet container. I > suppose a 0 file upload should be allowed, or is it considered an aborted > strea

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Maurizio Cucchiara
Looking at the stacktrace you reported, it is obvious that's a java thing: at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:137) 2011/1/18 Paul Benedict : > Burton, > > I don't know if this is an issue with Struts or the servlet container. I > s

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Paul Benedict
Burton, I don't know if this is an issue with Struts or the servlet container. I suppose a 0 file upload should be allowed, or is it considered an aborted stream? I don't know. It's an interesting question. Paul On Tue, Jan 18, 2011 at 3:33 PM, Burton Rhodes wrote: > Paul & Maurizio - > > Point

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Maurizio Cucchiara
My guess is that is more a java thing (File.renameTo method) Assuming that you don't need empty files you could use expression validation: File cannot be empty 2011/1/18 Burton Rhodes : > Bump. > > Has anyone t

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Paul Benedict
What good is a 0 byte file? On Tue, Jan 18, 2011 at 3:21 PM, Maurizio Cucchiara < maurizio.cucchi...@gmail.com> wrote: > Do you want allow empty files or avoid exception stuff? > > 2011/1/18 Burton Rhodes : > > Bump. > > > > Has anyone tried to upload an empty file using Struts2/Apache/Tomcat > >

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Maurizio Cucchiara
Do you want allow empty files or avoid exception stuff? 2011/1/18 Burton Rhodes : > Bump. > > Has anyone tried to upload an empty file using Struts2/Apache/Tomcat > configuration - e.g. test.txt with 0 bytes?  I have stepped through > the FileUploadInterceptor Class and cannot locate why an empty

Re: [S2] Struts doesn't upload 0 byte files?

2011-01-18 Thread Burton Rhodes
Bump. Has anyone tried to upload an empty file using Struts2/Apache/Tomcat configuration - e.g. test.txt with 0 bytes? I have stepped through the FileUploadInterceptor Class and cannot locate why an empty file is not uploaded to the "work" directory. When I upload a file that is 1+ bytes in size

Redirect & RedirectAction forwarding to localhost:8080 if no protocol mentioned in namespace

2011-01-18 Thread Harsh Grover
I'm using redirectAction to send the user to another action using redirectAction. However, if the namespace is not provided, the request is getting forwarded to localhost:8080 (my server instance). I'm using apache in front of my app server, and this is breaking my flow. Is there any configuration

Re: Dynamic dropDown List

2011-01-18 Thread Chris Pratt
Unfortunately the tag doesn't work like the HTML element. If that's what you are trying to do you could either set up the list to be displayed in the action and reference it in the "list" attribute, or you could just use and and build it yourself. (*Chris*) On Tue, Jan 18, 2011 at 12:37 AM

Create/Update with nested domain objects

2011-01-18 Thread Alfredo Manuel Osorio Martinez
Hello, I have seen examples that show how to do CRUD with one domain object without nested domain objects (just primitives). Giving the following example: @Entity public class Person implements Serializable { @Id private Long id; private String name; private Intege

AW: Dynamic dropDown List

2011-01-18 Thread mre...@4sxs.de
Hi Chris, Thank you for your reply, I had already try with the iterator but I had two problem: - I would like to put the <:property value="name"> in a dropdown List () - the answerList from the second iterator, depends from the current item from the first list Something like: