简体   繁体   中英

Spring-Boot 2 with Angular

I am using Spring Boot 2.1.4.RELEASE with Angular 2. Currently I keep my Angular code in /static directory. This is deployed in an external (not embedded) tomcat 9.

Default Spring boot error controller returns WhiteLabel html error page response if the request comes from the browser and json error response if the request is a rest request.

How can I override default whitelabel error page with custom html error page if the request comes from a browser but still get the json error response if the request is a rest request ?

Just created public/error folder and put specific error pages in the folder. WhiteError page is replaced by the error pages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM