Struts2 ActionContext and ValueStack?

前端 未结 2 1520
遇见更好的自我
遇见更好的自我 2021-01-14 08:38

My questions are:

  1. In Struts2, does every action object have its own corresponding ActionContext and ValueStack?

In other words, for every new re

2条回答
  •  终归单人心
    2021-01-14 09:01

    Q1. There is one ActionContext and there is only one ValueStack.

    Q2.

    Does this mean that previous ActionContext and ValueStack (related to action1) gets destroyed and a new ActionContext and ValueStack (for action2) gets created?

    No.

    Q3. I don't understand this question. What I think is missing is awareness of ThreadLocal so although there is one ActionContext each thread is able to have its own variables which are local to that thread and thus action scope for the ValueStack is maintained this way.

提交回复
热议问题