国产探花免费观看_亚洲丰满少妇自慰呻吟_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.



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 洪雅县| 唐海县| 五台县| 禹城市| 灌云县| 济南市| 拜泉县| 滕州市| 会宁县| 拜泉县| 山阳县| 浦县| 潍坊市| 普洱| 巴青县| 德兴市| 麦盖提县| 三穗县| 鄂尔多斯市| 刚察县| 乐昌市| 泸西县| 健康| 顺义区| 巧家县| 都匀市| 枣庄市| 寿阳县| 东港市| 奈曼旗| 吉木乃县| 略阳县| 洛阳市| 女性| 柘荣县| 子长县| 深圳市| 鄂尔多斯市| 磐石市| 舒城县| 楚雄市|