B04.JEE Frameworks‎ > ‎02.SSH‎ > ‎

01.(V)Apache Struts 2

Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time.

Apache Struts 2 was originally known as WebWork 2. After working independently for several years, the WebWork and Struts communities joined forces to create Struts2. This new version of Struts is simpler to use and closer to how Struts was always meant to be.


concepts




Site, http://struts.apache.org/
  • Filter Dispatcher
    • 處理使用者請求
  • Interceptors

  • Actions
  • Results
  • Plug-ins


Setting web.xml





Setting Struts.xml



  • WEB-INF/classes/struts.xml



http://struts.apache.org/2.1.8.1/docs/hello-world-using-struts-2.html



ActionSupports



extends ActionSupport

Action

  • Default: execute(), public String execute()


TextProvider

  • Message





Comments