[ 
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.

Reply via email to