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


Reply via email to