You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Herbert (JIRA)" <ji...@apache.org> on 2011/01/04 22:36:46 UTC
[jira] Created: (WW-3552) File Upload Interceptor Support for
custom TextProviders
File Upload Interceptor Support for custom TextProviders
--------------------------------------------------------
Key: WW-3552
URL: https://issues.apache.org/jira/browse/WW-3552
Project: Struts 2
Issue Type: Bug
Components: Core Interceptors
Affects Versions: 2.2.1
Reporter: Herbert
Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
example:
<bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
<constant name="struts.xworkTextProvider" value="myTextProvider" />
The struts2 core FileUploadInterceptor doesn't use this new custom TextProvider hence it uses XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] [Resolved] (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart resolved WW-3552.
-------------------------------
Resolution: Fixed
Done, added support for custom TextProvider and change getTextMessage() methods to be protected
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Lukasz Lenart
> Fix For: 2.3.1
>
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Diego Díez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993237#comment-12993237 ]
Diego Díez commented on WW-3552:
--------------------------------
Lately I've been trying to get i18n messages from a custom TextProvider implementation (messages from .xml instead .properties).
I've got messages (validation & conversion) correctly displayed from my xml, but messages from FileUploadInterceptor and TokenInterceptor are still using the properties.
I think a way to solve this issue could be change the LocalizedTextUtil.findText call, to something similiar to the use of TextProvider in the ActionSupport class, "getTextProvider().getText(...)".
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maurizio Cucchiara reassigned WW-3552:
--------------------------------------
Assignee: Maurizio Cucchiara
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] [Commented] (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Lorenzo Bernacchioni (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416200#comment-13416200 ]
Lorenzo Bernacchioni commented on WW-3552:
------------------------------------------
I agree, FileUploadInterceptor should get messages in the same way actions (and validations and other stuff) do.
Moreover the signature of the method
private String getTextMessage(Object action, String messageKey, Object[] args, Locale locale)
cannot be overridden by customized implementation.
Could at least be a protected method?
Meanwhile I have to override the whole interceptor just to put the line suggested by Diego Díez.
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
> Fix For: 2.3.1
>
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Diego Díez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Diego Díez updated WW-3552:
---------------------------
Comment: was deleted
(was: I've solved my problem adding this piece of code instead using LocalizedTextUtil class:
if (action instanceof TextProvider) {
message = ((TextProvider)action).getText(messageKey);
}
It do the trick for me)
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Diego Díez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993774#comment-12993774 ]
Diego Díez commented on WW-3552:
--------------------------------
I've solved my problem adding this piece of code instead using LocalizedTextUtil class:
if (action instanceof TextProvider) {
message = ((TextProvider)action).getText(messageKey);
}
It do the trick for me
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419800#comment-13419800 ]
Hudson commented on WW-3552:
----------------------------
Integrated in Struts2 #500 (See [https://builds.apache.org/job/Struts2/500/])
WW-3552 adds usage of TextProvider to allow provide user's implementation (Revision 1364066)
Result = SUCCESS
lukaszlenart :
Files :
* /struts/struts2/trunk/core/src/main/java/org/apache/struts2/StrutsConstants.java
* /struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java
* /struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/FileUploadInterceptor.java
* /struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/TokenInterceptor.java
* /struts/struts2/trunk/core/src/main/resources/org/apache/struts2/struts-messages.properties
* /struts/struts2/trunk/core/src/main/resources/struts-default.xml
* /struts/struts2/trunk/core/src/test/java/org/apache/struts2/interceptor/FileUploadInterceptorTest.java
* /struts/struts2/trunk/core/src/test/resources/org/apache/struts2/interceptor
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/DefaultLocaleProvider.java
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
* /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/providers/XWorkConfigurationProvider.java
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Lukasz Lenart
> Fix For: 2.3.1
>
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maurizio Cucchiara resolved WW-3552.
------------------------------------
Resolution: Not A Problem
Fix Version/s: 2.3
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
> Fix For: 2.3
>
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977683#action_12977683 ]
Maurizio Cucchiara commented on WW-3552:
----------------------------------------
I'm not sure this is a bug.
Probably I'm missing something, why should a custom text provider be useful in the interceptors' context?
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Diego Díez (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12993773#comment-12993773 ]
Diego Díez commented on WW-3552:
--------------------------------
I've solved my problem adding this piece of code instead using LocalizedTextUtil class:
if (action instanceof TextProvider) {
message = ((TextProvider)action).getText(messageKey);
}
It do the trick for me
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Maurizio Cucchiara
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Lukasz Lenart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lukasz Lenart reopened WW-3552:
-------------------------------
Assignee: Lukasz Lenart (was: Maurizio Cucchiara)
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
> Assignee: Lukasz Lenart
> Fix For: 2.3.1
>
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (WW-3552) FileUploadInterceptor and
TokenInterceptor should use the configured custom TextProvider
Posted by "Herbert (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WW-3552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Herbert updated WW-3552:
------------------------
Description:
Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
example:
<bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
<constant name="struts.xworkTextProvider" value="myTextProvider" />
The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
was:
Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
example:
<bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
<constant name="struts.xworkTextProvider" value="myTextProvider" />
The struts2 core FileUploadInterceptor doesn't use this new custom TextProvider hence it uses XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
Summary: FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider (was: File Upload Interceptor Support for custom TextProviders)
> FileUploadInterceptor and TokenInterceptor should use the configured custom TextProvider
> ----------------------------------------------------------------------------------------
>
> Key: WW-3552
> URL: https://issues.apache.org/jira/browse/WW-3552
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.2.1
> Reporter: Herbert
>
> Struts2 supports the usage of a custom text provider by setting some environment constants in struts.xml:
> example:
> <bean class="test.CustomTextProvider" name="myTextProvider" type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> The struts2 core FileUploadInterceptor and the TokenInterceptor don't use this new custom TextProvider hence they use XWork's LocalizedTextUtil class to lookup translations. Why the translations don't get resolved via an injected TextProvider?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.