← Back to team overview

dhis2-devs-core team mailing list archive

Removing of Jackson XML/JSON view resolvers

 

Hi everyone

Yesterday I removed JacksonXml/JsonView (view resolvers) as they are not in
use anymore. Turns out these have been hiding a few bugs in the
controllers, so you might end up seeing errors like this somewhere:

javax.servlet.ServletException: Could not resolve view with name
'maintenance' in servlet with name 'webapiServlet'
at
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1226)
at
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968

In general the cause is that we have PUT/POST methods without touching the
status, res, or generally doing nothing to report back.

The quickfix to this is to simply set:
@ResponseStatus( HttpStatus.NO_CONTENT )

on the method, I will go through most of the controllers now and check..
but let me know if you see error similar to above

-- 
Morten Olav Hansen
Senior Engineer, DHIS 2
University of Oslo
http://www.dhis2.org