At a high level, how does struts2 work? I'm coming from a mvc background

前端 未结 2 1510
攒了一身酷
攒了一身酷 2020-12-18 11:12

At a high level, how does struts2 work? I\'m coming from a mvc background

Looking at a sample project, I see allot of these ___action type classes.

Is it jus

2条回答
  •  甜味超标
    2020-12-18 11:56

    The way I always understood it is that actions are your controllers. You hit a url, you map it to an action, your action controls what business logic happens, like "load domain object" or "just go to jsp".

    The jsps are your views. I think if you are building a RIA where actions are handling xhrs and returning json, The V component of MVC is outside the framework -- its your extjs or whatever you are using for presentation.

    Struts has always seemed like really a VC framework, because you don't define your model with struts. You do that yourself. Although you use the model in struts, when you convert your model to whatever your presentation needs.

提交回复
热议问题