Class AbstractJsonServerAction<T>

Type Parameters:
T - Type to convert to JSON.
All Implemented Interfaces:
Action, ValidationAware, LocaleProvider, TextProvider, Validateable, Serializable, BrowserTabAware, BrowserTabAware2, LoggingAware, ValidationAware2, Action, ServletRequestAware, ServletResponseAware, ValidationAware, Validateable

public abstract class AbstractJsonServerAction<T> extends AbstractActionSupport implements ServletResponseAware

Template class of Struts 2 action for serving Json data of generic type T, usually for JQuery-based pages using jQuery.getJSON.

The following is an example for generic type T:

  public static class ProcessParamItem {
      @JsonProperty("value")
      private String value;
      

      public String getValue() {
          return value;
      }
      public void setValue(String value) {
          this.value = value;
      }
       
      public String toString() {
          return "ProcessParamItem [value=" + value + "]";
      }
  }
See Also:
  • Constructor Details

    • AbstractJsonServerAction

      public AbstractJsonServerAction()
  • Method Details