Struts experience - Dispatchaction uses diary

xiaoxiao2021-03-06  17

Struts1.1 has been released for so long, I just started systematically learning Struts related knowledge, after the previous median research, there has been further understanding of the class Dispatchaction in Struts1.1. I will summarize here, I hope to help everyone.

In version 1.0 we usually use the Execute method to complete our process and page forwarding of business logic. Usually we can only complete a business logic in an action. If we don't have a way to complete multiple business logics (such as: add, delete, etc.), do we have a way? The answer is negative, we can define a hidden variable in the page, we can give this variable different values ​​when different page requirements are required, and in the Execute method to complete the determination of variable values. Different business logic operations.

For example, we first define a hidden variable on the page.

Then define a JavaScript function, we can modify its value in the function body when you click the Submit button.