(Abnormal handling) Struts framework exception handling mechanism

xiaoxiao2021-03-06  82

The Struts framework provides support for exception processing in the view layer and the control layer.

User request

-----------------------------> Controller ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------------->model

| <---------------------------------

|

|

Localized error message ¿

<------------------------------

Struts framework process abnormal process

The Struts controller is responsible for capturing various exceptions, including the exception thrown in the controller, and the exception thrown when the model is called.

1. After the Struts controller captures the abnormality, create an actionMessage object that describes a message in an exception handling block, saves it in the ACionMessages object, and then saves the actionMessages at a specific range.

2, Retrieve an ActionMessages object within a specific range.

转载请注明原文地址:https://www.9cbs.com/read-105947.html

New Post(0)