Why doesn't just autowiring a field in a GWT servlet in Spring work?
问题 Simply marking a field as @Autowired in a GWT servlet does not work as intended. The code will compile and the web application will start up - which means Spring was successfully able to autowire the field, but when the servlet is actually hit by client-side code, it will yield a NullPointerException - like there's a different, uninitialized copy of the servlet being hit. I've found several ways on the web to get this working, one is by using a base servlet class that does some Spring logic