国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Sunil Patil 告訴你如何擴展Struts

2019-11-17 06:07:47
字體:
來源:轉載
供稿:網友

 by Sunil Patil
11/10/2004

IntrodUCtion

I have seen lot of PRojects where the developers implemented a proprietary MVC framework, not because they wanted to do something fundamentally different from Struts, but because they were not aware of how to extend Struts. You can get total control by developing your own MVC framework, but it also means you have to commit a lot of resources to it, something that may not be possible in projects with tight schedules.

Struts is not only a very powerful framework, but also very extensible. You can extend Struts in three ways.

  1. PlugIn: Create your own PlugIn class if you want to execute some business logic at application startup or shutdown.
  2. RequestProcessor: Create your own RequestProcessor if you want to execute some business logic at a particular point during the request-processing phase. For example, you might extend RequestProcessor to check that the user is logged in and he has one of the roles to execute a particular action before executing every request.
  3. ActionServlet: You can extend the ActionServlet class if you want to execute your business logic at either application startup or shutdown, or during request processing. But you should use it only in cases where neither PlugIn nor RequestProcessor is able to fulfill your requirement.

In this article, we will use a sample Struts application to demonstrate how to extend Struts using each of these three approaches. Downloadable sample code for each is available below in the Resources section at the end of this article. Two of the most successful examples of Struts extensions are the Struts Validation framework and the Tiles framework.



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大邑县| 正定县| 克山县| 横峰县| 深水埗区| 岫岩| 攀枝花市| 洛浦县| 阳东县| 宁蒗| 巫山县| 略阳县| 罗源县| 乌鲁木齐市| 汉中市| 胶州市| 西城区| 惠水县| 寻乌县| 信丰县| 原平市| 惠安县| 绥芬河市| 沾化县| 莆田市| 磴口县| 宽甸| 孝昌县| 广平县| 泸州市| 永吉县| 明溪县| 鄄城县| 沭阳县| 吉木萨尔县| 涿鹿县| 喀喇| 海原县| 沙河市| 洞口县| 四川省|