简体   繁体   English

具有Angular的Spring-Boot 2

[英]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. 我正在使用带有Angular 2的Spring Boot 2.1.4.RELEASE。目前我将Angular代码保存在/ static目录中。 This is deployed in an external (not embedded) tomcat 9. 这部署在外部(非嵌入式)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. 如果请求来自浏览器,则默认Spring引导错误控制器返回WhiteLabel html错误页面响应,如果请求是休息请求,则返回json错误响应。

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 ? 如果请求来自浏览器但如果请求是休息请求仍然得到json错误响应,如何使用自定义html错误页面覆盖默认的whitelabel错误页面?

Just created public/error folder and put specific error pages in the folder. 刚创建公共/错误文件夹并将特定错误页面放在该文件夹中。 WhiteError page is replaced by the error pages WhiteError页面被错误页面替换

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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