xwork

XWork2 整合到Struts2. XWork1 整合到 WebWork.

XWork is an command-pattern framework that is used to power Struts 2 as well as other applications. XWork provides an Inversion of Control container, a powerful expression language, data type conversion, validation, and pluggable configuration.


关于xwork:

XWork 2 is a generic command pattern framework. It forms the core of Struts 2. It features:

    * Flexible and customizable configuration based on a simple Configuration interface, allowing you to use XML , programmatic, or even product-integrated configuration
    * Core command pattern framework which can be customized and extended through the use of interceptors to fit any request / response environment
    * Built in type conversion and action property validation using OGNL
    * Powerful validation framework based on runtime attributes and a validation interceptor

总览:
Xwork is a command pattern framework centralized around an Action interface. You define action classes by implementing an Action interface, then XWork will setup and execute your actions. XWork is most widely known from the web MVC framework called Webwork. However, XWork can be used by itself, so its important to understand the XWork layers and how actions are set up and executed.

http://wiki.opensymphony.com/display/XW/XWork+Features

The Action Interface

The basic interface which all XWork actions must implement. It provides several standard return values like SUCCESS and INPUT, and only contains one method:
Action.java

public interface Action {
    public static final String SUCCESS = "success";
    public static final String NONE = "none";
    public static final String ERROR = "error";
    public static final String INPUT = "input";
    public static final String LOGIN = "login";
   
    public String execute() throws Exception;

In general, Actions can simply extend the com.opensymphony.xwork.ActionSupport class, which implements the Action interface and provides default behavior for the most common actions.
Action lifecycles are maintained thru the ActionProxy interface. ActionProxy is the top layer in the Xwork API and should be the starting point to setup and execute actions. XWork provides a factory as an entry point to instantiate action proxies. Most of the implementations of each xwork layer are hidden behind interfaces making it very easy to override the default implementations for complete customization.

你可能感兴趣的:(mvc,Web,struts,Webwork,UP)