Hello everyone, I have a type converter that needs to get access to my Spring managed service so it can do a DB lookup. I was under the impression that the struts-spring plug-in handled DI for the converter. However, when the convertFromString method tries to access the service called statusService, I get a NPE. What am I doing wrong?
Any reply would be appreciated, Cheers! MG public class StatusTypeConverter extends StrutsTypeConverter { StatusService statusService; @Override public Object convertFromString(Map context, String[] values, Class toClass) { Status retVal = null; if (values != null && values.length > 0 && values[0] != null && values[0].length() > 0) { String[] ids = (String[]) values; Integer id = new Integer(ids[0]); retVal = statusService.getStatus(id); // NPE thrown here!! } return retVal; } @Override public String convertToString(Map arg0, Object object) { String retVal = ""; if (object instanceof Status) { Status s = (Status) object; retVal = s.getDescription(); } return retVal; } public void setStatusService(StatusService statusService) { this.statusService = statusService; } } --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org