[
https://issues.apache.org/jira/browse/WW-3790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13254573#comment-13254573
]
Joaquin Diez commented on WW-3790:
----------------------------------
Hi Lukasz,
this the code definiticion of my class, as you can see I got a
BasicControllecAction which extend from extends BaseAction implements
SessionAware
The constructor now is commented, because when I had a constructor for the
Action.. the this.getText()... did not run the Custom TextProvider I coded.
After change that, everything started to work as I expected. So now I have
eliminated all the constructor from my Actions.
public class AlertsViewAction extends BasicControllerAction {
private AlertService alertService;
private AlertViewService alertViewService;
public List<AlertView> avList;
private int limit; // numero maximo de alertas a recibir.
private int offset;// apartir de que numero de alerta solicitar.
private boolean hasAck = true;
private String period;
private Map<String, String> listTimePeriod = new HashMap<String, String>();
public Map<String, String> getListTimePeriod() {
return listTimePeriod;
}
/**
public AlertsViewAction() {
super();
try {
if (listTimePeriod.isEmpty()) {
listTimePeriod.put("0_lastday", this.getText("label.lastday"));
listTimePeriod.put("1_lastweek",
this.getText("label.lastweek"));
listTimePeriod.put("2_last2week",
this.getText("label.last2week"));
listTimePeriod.put("3_lastmonth",
this.getText("label.lastmonth"));
listTimePeriod.put("4_last6months",
this.getText("label.last6months"));
listTimePeriod.put("5_lastyear",
this.getText("label.lastyear"));
}
} catch (Exception e) {
log.error(e);
}
}
*/
> Unable to Use My Custom TextProvider from Action getText() methos
> -----------------------------------------------------------------
>
> Key: WW-3790
> URL: https://issues.apache.org/jira/browse/WW-3790
> Project: Struts 2
> Issue Type: Bug
> Components: Core Actions
> Affects Versions: 2.3.1.2
> Reporter: Joaquin Diez
> Fix For: 2.3.3
>
>
> I build my own Text Provider with
> public class MyTextProvider extends TextProviderSupport ...
> and configure in struts.xml
> <bean class="lt.web.core.MyTextProvider" name="myTextProvider"
> type="com.opensymphony.xwork2.TextProvider" />
> <constant name="struts.xworkTextProvider" value="myTextProvider" />
> <constant name="system" value="myTextProvider" />
> But when i make inside and action.. this.getText("whatever"); in does not
> run my custom provider..
--
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