You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@gmail.com on 2007/06/04 21:08:09 UTC

Actions, Beans and Spring

I changed my action mapping class name to the bean id in my spring file and
I am not getting a new action created for each request!  The correct action
is being invoked, but it is not being created anew for each request.  I was
sure to set the scope=prototype" in the bean mapping, yet the logging I have
in my constructor never executes beyond the initial application startup!  I
have read everything I can get my hands on concerning S2 and Spring
interaction, yet I cannot determine why S2 is not asking Spring for a new
action object instance for each request.  Has anyone seen this behavior?



-- 
Scott
stanlick@gmail.com

Re: [S2] File Upload Question

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Ken,
Yes, the interface to your action is a File.  The default implementation 
uses the ServletFileUpload servlet from apache-commons-fileupload which 
does create a temporary file. 
You can switch to other implementations or configurations by changing 
some struts2 properties but the fileupload interceptor interface is 
still a File, not an InputStream. 
Personally I'd prefer the temporary file over an in-memory buffer, and 
prefer a temporary file in a safe part of the filesystem rather than 
allowing the file to be written elsewhere by the servlet.

However, it seems you have a lot of control over the implementation if 
this is a problem:
http://jakarta.apache.org/commons/fileupload/using.html

Hoying, Ken wrote:
> As I am reading up and looking into the file upload support in S2, it
> appears that files are uploaded to a temporary area and then deleted
> when control is returned from the action.  It would seem then that if I
> wanted to keep the file, that I then need to copy it again to somewhere
> else.  Is this understanding correct?  This seems a bit inefficient to
> me, especially for larger files. 
>
> Thanks in advance.
>
> -------

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


[S2] File Upload Question

Posted by "Hoying, Ken" <Ke...@PremierInc.com>.
As I am reading up and looking into the file upload support in S2, it
appears that files are uploaded to a temporary area and then deleted
when control is returned from the action.  It would seem then that if I
wanted to keep the file, that I then need to copy it again to somewhere
else.  Is this understanding correct?  This seems a bit inefficient to
me, especially for larger files. 

Thanks in advance.

-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.  

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org