Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Occasional java.lang.IllegalStateException in struts/spring

Shulou Source: shulou.com Published: 2022-06-03 07:58:20 11月05日 Update

Exception message:

Java.lang.IllegalStateException:Cannot call sendRedirect () after the response has been committed.

Cause of exception:

Multithreading concurrency results in

Solution:

Need to add the configuration of scope= "prototype"

This parameter tells spring to create an Action object for a http request

Without this parameter, the default parameter is the value singleton, which means that it is a singleton. A singleton object causes multithreaded reentry when concurrent requests are made.

Example configuration:

Tags: Parameters objects threads configuration information reasons methods examples Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno Linux Apple Redmi