You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org> on 2009/04/30 09:28:30 UTC

[jira] Created: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

max upload size cannot be reconfigured after app is deployed
------------------------------------------------------------

                 Key: TRINIDAD-1464
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
             Project: MyFaces Trinidad
          Issue Type: New Feature
    Affects Versions:  1.2.11-core
            Reporter: Matthias Weßendorf
            Assignee: Matthias Weßendorf


Currently the only way to configure the max upload size it to set context
parameters in web.xml. Some container do not provide any support for changing
web.xml during or after deployment...

Applications needs to be able to change the max upload size after deployment.

This could be done by providing an implementation of
org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
would be a relatively simple variation on
org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 

We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by "Mark Yvanovich (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711140#action_12711140 ] 

Mark Yvanovich commented on TRINIDAD-1464:
------------------------------------------

Rather than nesting the config settings, I think a flat approach for the names will be easier to implement.

    <uploaded-file-max-memory>#{bean.blah}</uploaded-file-max-memory>
    <uploaded-file-max-disc-space>#{bean.blub}</uploaded-file-max-disc-space>
    <uploaded-file-temp-dir>#{bean.fooDir}</uploaded-file-temp-dir>


> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
> We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711142#action_12711142 ] 

Matthias Weßendorf commented on TRINIDAD-1464:
----------------------------------------------

I had a grouping in mind to make is cleaner, however I agree, 
as the current code is completely written that way...
(There are other elements a possible candidate for some grouping as well...)

> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
> We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704509#action_12704509 ] 

Matthias Weßendorf commented on TRINIDAD-1464:
----------------------------------------------

The most simple case would be to enhance the UploadedFileProcessor, by adding some s/getConfiguration() method.
However, that causes serious problems for 3rd party implementations (fragile base class problem).

A smarter adapter would be needed...

> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
> We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by Matthias Wessendorf <ma...@apache.org>.
follow up on the suggested EL scheme approach:

Using EL scheme inside the trinidad config:
By that the application EL binds the trinidad-config (new) attributes.
On each request the (current) implementation of the UploadProcessor
rereads the EL-bound attributes. Therefore the application is free to
use any scheme it wants to determine the maximum size, including doing
so on a per-user or per-user-per-request basis.

Notes on the implementation:

For that we change/enhance the trinidad-config (and its XSD) to allow
something like this:

<trinidad-config...>
...
  <uploaded-file-processor-settings>
    <upload-max-memory>#{bean.blah}</upload-max-memory>
    <upload-max-disc-space>#{bean.blub}</upload-max-disc-space>
    <upload-temp-dir>#{bean.fooDir}</upload-temp-dir>
  </uploaded-file-processor-settings>
...
</trinidad-config>

The problem here is that the actual upload is done in front of JSF
lifecycle and the Configurator implementation as no access to the
ELContext (only to an ExternalContext impl)...
However, we still can use the EL approach, by using a work around:
-We evaluate the EL at the end of the request and stuff it into the session
-On the actual upload we just read the value from the session (inside
of the upload processor implementation)

Because of backward compatibility we still need to support the web.xml
based settings, however when trinidad-config is used we prefer
that....

-Matthias


On Wed, May 6, 2009 at 7:20 PM, Matthias Wessendorf <ma...@apache.org> wrote:
>> My thinking was that the application EL binds the trinidad-config
>> attribute.  Since we reread the EL-bound attributes on each request, the
>> application is free to use any scheme it wants to determine the maximum
>> size, including doing so on a per-user or per-user-per-request basis.
>
> oh yeah. correct.
> Let me update the jira ticket according to that.
>
> -Matthias
>
>>
>> -- Blake Sullivan
>>
>> On Fri, May 1, 2009 at 7:18 PM, Blake Sullivan
>> <bl...@oracle.com> wrote:
>>
>>
>> Matthias,
>>
>> Would things be improved if we moved the configuration to
>> trinidad-config.xml and allowed the configuration to be retrieved on a
>> per-request basis?
>>
>> -- Blake Sullivan
>>
>> Matthias Weßendorf (JIRA) said the following On 5/1/2009 4:25 AM PT:
>>
>>     [
>> https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704962#action_12704962
>> ]
>>
>> Matthias Weßendorf commented on TRINIDAD-1464:
>> ----------------------------------------------
>>
>> One possible approach:
>> *create a new abstract class in the Trinidad API "FileUploadConfig"
>> and define abstract get/set methods for "maxMemory", "maxDiskSpace"
>> and "tempDir".
>>
>> *every implementation of the UploadedFileProcessor that wants to change
>> the configuration during runtime should not only implement the actual
>> UploadedFileProcessor interface, it also has to implement the abstract
>> "FileUploadConfig" class. The UploadFileProcessorImpl (default) would
>> do that too.
>>
>> *since the FileUploadConfig implementation is shared over all sessions
>> (application scoped), the implementor (e.g. the UploadFileProcessorImpl)
>> needs to be aware of writing thread-safety code, when *setting* the new
>> value...
>>
>> possible usage in an action-method:
>> ...
>> FileUploadConfig fuc = null;
>> UploadedFileProcessor ufp = requestCtx.getUploadedFileProcessor();
>> if(ufp instanceof FileUploadConfig)
>> {
>>  fuc = (FileUploadConfig) ufp;
>>  fuc.setMax.....(....);
>> }
>> ...
>>
>>
>>
>> max upload size cannot be reconfigured after app is deployed
>> ------------------------------------------------------------
>>
>>                 Key: TRINIDAD-1464
>>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>>             Project: MyFaces Trinidad
>>          Issue Type: New Feature
>>    Affects Versions:  1.2.11-core
>>            Reporter: Matthias Weßendorf
>>            Assignee: Matthias Weßendorf
>>
>> Currently the only way to configure the max upload size it to set context
>> parameters in web.xml. Some container do not provide any support for
>> changing
>> web.xml during or after deployment...
>> Applications needs to be able to change the max upload size after
>> deployment.
>> This could be done by providing an implementation of
>> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that
>> would be a relatively simple variation on
>> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl
>> We need to find a good way to dynamically change those configuration
>> settings
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: [jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by Matthias Wessendorf <ma...@apache.org>.
> My thinking was that the application EL binds the trinidad-config
> attribute.  Since we reread the EL-bound attributes on each request, the
> application is free to use any scheme it wants to determine the maximum
> size, including doing so on a per-user or per-user-per-request basis.

oh yeah. correct.
Let me update the jira ticket according to that.

-Matthias

>
> -- Blake Sullivan
>
> On Fri, May 1, 2009 at 7:18 PM, Blake Sullivan
> <bl...@oracle.com> wrote:
>
>
> Matthias,
>
> Would things be improved if we moved the configuration to
> trinidad-config.xml and allowed the configuration to be retrieved on a
> per-request basis?
>
> -- Blake Sullivan
>
> Matthias Weßendorf (JIRA) said the following On 5/1/2009 4:25 AM PT:
>
>     [
> https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704962#action_12704962
> ]
>
> Matthias Weßendorf commented on TRINIDAD-1464:
> ----------------------------------------------
>
> One possible approach:
> *create a new abstract class in the Trinidad API "FileUploadConfig"
> and define abstract get/set methods for "maxMemory", "maxDiskSpace"
> and "tempDir".
>
> *every implementation of the UploadedFileProcessor that wants to change
> the configuration during runtime should not only implement the actual
> UploadedFileProcessor interface, it also has to implement the abstract
> "FileUploadConfig" class. The UploadFileProcessorImpl (default) would
> do that too.
>
> *since the FileUploadConfig implementation is shared over all sessions
> (application scoped), the implementor (e.g. the UploadFileProcessorImpl)
> needs to be aware of writing thread-safety code, when *setting* the new
> value...
>
> possible usage in an action-method:
> ...
> FileUploadConfig fuc = null;
> UploadedFileProcessor ufp = requestCtx.getUploadedFileProcessor();
> if(ufp instanceof FileUploadConfig)
> {
>  fuc = (FileUploadConfig) ufp;
>  fuc.setMax.....(....);
> }
> ...
>
>
>
> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for
> changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after
> deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl
> We need to find a good way to dynamically change those configuration
> settings
>
>
>
>
>
>
>
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: [jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by Blake Sullivan <bl...@oracle.com>.
Matthias Wessendorf said the following On 5/5/2009 10:01 PM PT:
> Hi Blake,
>
> the idea is to change the upload-config during runtime.
> Not sure how moving it to trinidad-config helps to change it
> via an Java API.
>
> -Matthias
>   
My thinking was that the application EL binds the trinidad-config 
attribute.  Since we reread the EL-bound attributes on each request, the 
application is free to use any scheme it wants to determine the maximum 
size, including doing so on a per-user or per-user-per-request basis.

-- Blake Sullivan

> On Fri, May 1, 2009 at 7:18 PM, Blake Sullivan
> <bl...@oracle.com> wrote:
>   
>> Matthias,
>>
>> Would things be improved if we moved the configuration to
>> trinidad-config.xml and allowed the configuration to be retrieved on a
>> per-request basis?
>>
>> -- Blake Sullivan
>>
>> Matthias Weßendorf (JIRA) said the following On 5/1/2009 4:25 AM PT:
>>
>>     [
>> https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704962#action_12704962
>> ]
>>
>> Matthias Weßendorf commented on TRINIDAD-1464:
>> ----------------------------------------------
>>
>> One possible approach:
>> *create a new abstract class in the Trinidad API "FileUploadConfig"
>> and define abstract get/set methods for "maxMemory", "maxDiskSpace"
>> and "tempDir".
>>
>> *every implementation of the UploadedFileProcessor that wants to change
>> the configuration during runtime should not only implement the actual
>> UploadedFileProcessor interface, it also has to implement the abstract
>> "FileUploadConfig" class. The UploadFileProcessorImpl (default) would
>> do that too.
>>
>> *since the FileUploadConfig implementation is shared over all sessions
>> (application scoped), the implementor (e.g. the UploadFileProcessorImpl)
>> needs to be aware of writing thread-safety code, when *setting* the new
>> value...
>>
>> possible usage in an action-method:
>> ...
>> FileUploadConfig fuc = null;
>> UploadedFileProcessor ufp = requestCtx.getUploadedFileProcessor();
>> if(ufp instanceof FileUploadConfig)
>> {
>>  fuc = (FileUploadConfig) ufp;
>>  fuc.setMax.....(....);
>> }
>> ...
>>
>>
>>
>> max upload size cannot be reconfigured after app is deployed
>> ------------------------------------------------------------
>>
>>                 Key: TRINIDAD-1464
>>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>>             Project: MyFaces Trinidad
>>          Issue Type: New Feature
>>    Affects Versions:  1.2.11-core
>>            Reporter: Matthias Weßendorf
>>            Assignee: Matthias Weßendorf
>>
>> Currently the only way to configure the max upload size it to set context
>> parameters in web.xml. Some container do not provide any support for
>> changing
>> web.xml during or after deployment...
>> Applications needs to be able to change the max upload size after
>> deployment.
>> This could be done by providing an implementation of
>> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that
>> would be a relatively simple variation on
>> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl
>> We need to find a good way to dynamically change those configuration
>> settings
>>
>>
>>
>>
>>     
>
>
>
>   


Re: [jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by Matthias Wessendorf <ma...@apache.org>.
Hi Blake,

the idea is to change the upload-config during runtime.
Not sure how moving it to trinidad-config helps to change it
via an Java API.

-Matthias

On Fri, May 1, 2009 at 7:18 PM, Blake Sullivan
<bl...@oracle.com> wrote:
> Matthias,
>
> Would things be improved if we moved the configuration to
> trinidad-config.xml and allowed the configuration to be retrieved on a
> per-request basis?
>
> -- Blake Sullivan
>
> Matthias Weßendorf (JIRA) said the following On 5/1/2009 4:25 AM PT:
>
>     [
> https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704962#action_12704962
> ]
>
> Matthias Weßendorf commented on TRINIDAD-1464:
> ----------------------------------------------
>
> One possible approach:
> *create a new abstract class in the Trinidad API "FileUploadConfig"
> and define abstract get/set methods for "maxMemory", "maxDiskSpace"
> and "tempDir".
>
> *every implementation of the UploadedFileProcessor that wants to change
> the configuration during runtime should not only implement the actual
> UploadedFileProcessor interface, it also has to implement the abstract
> "FileUploadConfig" class. The UploadFileProcessorImpl (default) would
> do that too.
>
> *since the FileUploadConfig implementation is shared over all sessions
> (application scoped), the implementor (e.g. the UploadFileProcessorImpl)
> needs to be aware of writing thread-safety code, when *setting* the new
> value...
>
> possible usage in an action-method:
> ...
> FileUploadConfig fuc = null;
> UploadedFileProcessor ufp = requestCtx.getUploadedFileProcessor();
> if(ufp instanceof FileUploadConfig)
> {
>  fuc = (FileUploadConfig) ufp;
>  fuc.setMax.....(....);
> }
> ...
>
>
>
> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for
> changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after
> deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl
> We need to find a good way to dynamically change those configuration
> settings
>
>
>
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: [jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by Blake Sullivan <bl...@oracle.com>.
Matthias,

Would things be improved if we moved the configuration to 
trinidad-config.xml and allowed the configuration to be retrieved on a 
per-request basis?

-- Blake Sullivan

Matthias Weßendorf (JIRA) said the following On 5/1/2009 4:25 AM PT:
>     [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704962#action_12704962 ] 
>
> Matthias Weßendorf commented on TRINIDAD-1464:
> ----------------------------------------------
>
> One possible approach:
> *create a new abstract class in the Trinidad API "FileUploadConfig"
> and define abstract get/set methods for "maxMemory", "maxDiskSpace"
> and "tempDir".
>
> *every implementation of the UploadedFileProcessor that wants to change
> the configuration during runtime should not only implement the actual
> UploadedFileProcessor interface, it also has to implement the abstract
> "FileUploadConfig" class. The UploadFileProcessorImpl (default) would
> do that too.
>
> *since the FileUploadConfig implementation is shared over all sessions
> (application scoped), the implementor (e.g. the UploadFileProcessorImpl)
> needs to be aware of writing thread-safety code, when *setting* the new value...
>
> possible usage in an action-method:
> ...
> FileUploadConfig fuc = null;
> UploadedFileProcessor ufp = requestCtx.getUploadedFileProcessor();
> if(ufp instanceof FileUploadConfig)
> {
>  fuc = (FileUploadConfig) ufp;
>  fuc.setMax.....(....);
> }
> ...
>
>   
>> max upload size cannot be reconfigured after app is deployed
>> ------------------------------------------------------------
>>
>>                 Key: TRINIDAD-1464
>>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>>             Project: MyFaces Trinidad
>>          Issue Type: New Feature
>>    Affects Versions:  1.2.11-core
>>            Reporter: Matthias Weßendorf
>>            Assignee: Matthias Weßendorf
>>
>> Currently the only way to configure the max upload size it to set context
>> parameters in web.xml. Some container do not provide any support for changing
>> web.xml during or after deployment...
>> Applications needs to be able to change the max upload size after deployment.
>> This could be done by providing an implementation of
>> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
>> would be a relatively simple variation on
>> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
>> We need to find a good way to dynamically change those configuration settings
>>     
>
>   


[jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704962#action_12704962 ] 

Matthias Weßendorf commented on TRINIDAD-1464:
----------------------------------------------

One possible approach:
*create a new abstract class in the Trinidad API "FileUploadConfig"
and define abstract get/set methods for "maxMemory", "maxDiskSpace"
and "tempDir".

*every implementation of the UploadedFileProcessor that wants to change
the configuration during runtime should not only implement the actual
UploadedFileProcessor interface, it also has to implement the abstract
"FileUploadConfig" class. The UploadFileProcessorImpl (default) would
do that too.

*since the FileUploadConfig implementation is shared over all sessions
(application scoped), the implementor (e.g. the UploadFileProcessorImpl)
needs to be aware of writing thread-safety code, when *setting* the new value...

possible usage in an action-method:
...
FileUploadConfig fuc = null;
UploadedFileProcessor ufp = requestCtx.getUploadedFileProcessor();
if(ufp instanceof FileUploadConfig)
{
 fuc = (FileUploadConfig) ufp;
 fuc.setMax.....(....);
}
...

> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
> We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf resolved TRINIDAD-1464.
------------------------------------------

       Resolution: Fixed
    Fix Version/s:  1.2.12-core

> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>             Fix For:  1.2.12-core
>
>         Attachments: trinidad1464.patch
>
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
> We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706769#action_12706769 ] 

Matthias Weßendorf commented on TRINIDAD-1464:
----------------------------------------------

Another approach is using EL scheme inside the trinidad config:

By that the application EL binds the trinidad-config (new) attributes. On each request the (current) implementation of the UploadProcessor rereads the EL-bound attributes. Therefore the application is free to use any scheme it wants to determine the maximum size, including doing so on a per-user or per-user-per-request basis.

Notes on the implementation:

For that we change/enhance the trinidad-config (and its XSD) to allow something like this:

<trinidad-config...>
...
  <uploaded-file-processor-settings>
    <upload-max-memory>#{bean.blah}</upload-max-memory>
    <upload-max-disc-space>#{bean.blub}</upload-max-disc-space>
    <upload-temp-dir>#{bean.fooDir}</upload-temp-dir>
  </uploaded-file-processor-settings>
...
</trinidad-config>

The problem here is that the actual upload is done in front of JSF lifecycle and the Configurator implementation as no access to the ELContext (only to an ExternalContext impl)...
We still can use EL approach, by using a work around:

-We evaluate the EL at the end of the request and stuff it into the session :-)
-On the actual upload we just read the value from the session (inside of the upload processor implementation)

Because of backward compatibility we still need to support the web.xml based settings, however when trinidad-config is used we prefer that....

> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
> We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1464) max upload size cannot be reconfigured after app is deployed

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12704963#action_12704963 ] 

Matthias Weßendorf commented on TRINIDAD-1464:
----------------------------------------------

Generally, the "problem" is that the UploadProcessor is shared across sessions (application scoped)
and therefore it could be possible that user #1 (for what ever reason) changes the max-upload to 1 kilobyte...
(in case the application developer would create such a stupid user-interface...)

Generally the usage of such a feature would only make sense in an admin-type GUI....

> max upload size cannot be reconfigured after app is deployed
> ------------------------------------------------------------
>
>                 Key: TRINIDAD-1464
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1464
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>    Affects Versions:  1.2.11-core
>            Reporter: Matthias Weßendorf
>            Assignee: Matthias Weßendorf
>
> Currently the only way to configure the max upload size it to set context
> parameters in web.xml. Some container do not provide any support for changing
> web.xml during or after deployment...
> Applications needs to be able to change the max upload size after deployment.
> This could be done by providing an implementation of
> org.apache.myfaces.trinidad.webapp.UploadedFileProcessor. However that 
> would be a relatively simple variation on
> org.apache.myfaces.trinidadinternal.config.upload.UploadedFileProcessorImpl 
> We need to find a good way to dynamically change those configuration settings

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.