在 Servlet 3.0 規格中,如果要求隨附查詢字串,則會使此字串可供已分派的資源使用。在 Servlet 3.1 規格中,如果為分派資源提供查詢字串,則會使此查詢字串(而非來自原始要求的查詢字串)可供已分派的資源使用。
下列範例將示範此行為差異:
不允許在呼叫 AsyncContext.dispatch() 或 AsyncContext.complete() 方法之後取得要求或回應物件,並且會導致下列異常狀況:
java.lang.IllegalStateException: SRVE9015E:
Cannot obtain the request or response object after an AsyncContext.dispatch() or AsyncContext.complete().
此規則會標示下列項目:
asyncSupported=true 屬性的 javax.servlet.annotation.WebServlet 註釋web.xml 及 web-fragment.xml 檔如需 Servlet 3.1 行為變更的相關資訊,請參閱下列資源: Servlet 3.1 行為變更。