У меня есть пользовательский тег. Когда я вставляю ресурс весеннего сообщения и хочу получить доступ к файлу свойств, инжектируемый компонент всегда имеет значение null. Что я делаю неправильно,Почему значение введенного компонента bean равно нулю
@Component
public class GridColumnsCutomTagHander extends TagSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
@Inject
private MessageSource messageSource;
private String propertyFileName;
/**
* @return the propertyFileName
*/
public String getPropertyFileName() {
return this.propertyFileName;
}
/**
* @param propertyFileName
* the propertyFileName to set
*/
public void setPropertyFileName(String propertyFileName) {
this.propertyFileName = propertyFileName;
}
@Override
public int doStartTag() throws JspException {
try {
JspWriter out = pageContext.getOut();
String gridColumnValues = messageSource.getMessage(propertyFileName,
null, EWMSUser.getCurrentLanguageLocale());
out.println(gridColumnValues);
} catch (IOException e) {
e.printStackTrace();
}
return (SKIP_BODY);
}
Пожалуйста, помогите мне в выяснении, где проблема
Что такое MessageSource? класс или интерфейс. Можете ли вы показать конфигурацию XML для весны – mahesh