<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>spring boot &#8211; Lhy&#039;s blog</title>
	<atom:link href="https://blog.lhyshome.com/tag/spring-boot/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.lhyshome.com</link>
	<description>welcome</description>
	<lastBuildDate>Tue, 21 May 2024 10:13:33 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">219834889</site>	<item>
		<title>spring boot捕获RuntimeException以json格式响应</title>
		<link>https://blog.lhyshome.com/2024/05/13/63/</link>
					<comments>https://blog.lhyshome.com/2024/05/13/63/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Mon, 13 May 2024 03:03:41 +0000</pubDate>
				<category><![CDATA[java]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[spring boot]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=63</guid>

					<description><![CDATA[响应类，json的本体 业务异常类 业务异常类的helper 重点是异常处理类上@RestController… <span class="read-more"><a href="https://blog.lhyshome.com/2024/05/13/63/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<p>响应类，json的本体</p>



<p>业务异常类</p>



<p>业务异常类的helper</p>



<p>重点是异常处理类上@RestControllerAdvice注解可以捕获处理springboot中的异常</p>



<p>方法上添加@ResponseStatus（标明响应的http状态）和@ExceptionHandler（标明处理哪个异常类信息），就可以在方法里返回自己需要的json格式</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2024/05/13/63/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">63</post-id>	</item>
	</channel>
</rss>
