Spring configuration interceptor can configure to intercept GET requests for only one connection and not POST requests?

  java, question
xml<!  -configure interceptor->
 <mvc:interceptors>
 <mvc:interceptor>
 <mvc:mapping path="/list" />
 <mvc:mapping path="/list/" />
 <bean class="com.web.interceptor.AppInterceptor"></bean>
 </mvc:interceptor>
 </mvc:interceptors>

If I just want to intercept/list/TheGetIs it okay to request?

During configuration, pass the request type to be processed to AppInterceptor, and then directly judge whether to process it in AppInterceptor’s preHandle method inside.

Get the current request type using String method = request.getMethod ();