1
I have an app that uses Jasper-Reports version 6.2.0 with spring-mvc version 3.2.14, java-ee-7, Tomcat 8 and at front-end we use Angularjs. The requisitions Rest are made via ajax.
The application is all ready to receive objects json as return of the requests, because the requests via Angularjs are all done via Ajax. In certain functionality of the application we have a "common" request using window.location = url
, because we need to return a streaming that is nothing more than an array of bytes to generate a PDF file.
With this, when there is some error in the back-end the answer goes to a blank screen with an object json printed in it.
I’ve used error handling with spring-mvc overall or by exception, either using treatment by annotations with Exceptionhandler or with Controlleradvice to generalize, but always treating classes in the control layer with annotation Controller returning an object Modelandview, but never classes in the service layer annotated with Service.
My doubt would be as when capturing the exception to make the spring-mvc redirect to an error screen in my common Get request cases with a parameterized message in this scenario that I described.
You could explain a little more what makes the createObjectURL(blob method)?
– Philippe Gioseffi