alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Struts example source code file (SMDActionTest1.java)

This example Struts source code file (SMDActionTest1.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Struts tags/keywords

bean, list, list, map, map, object, smdactiontest1, smdmethod, smdmethod, string, suppresswarnings, suppresswarnings, util

The Struts SMDActionTest1.java source code

/*
 * $Id: SMDActionTest1.java 799110 2009-07-29 22:44:26Z musachy $
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.struts2.json;

import java.util.List;
import java.util.Map;

import org.apache.struts2.json.annotations.SMDMethod;

public class SMDActionTest1 {
    private boolean addWasCalled;
    @SuppressWarnings("unchecked")
    private List listParam;
    @SuppressWarnings("unchecked")
    private Map mapParam;
    private Bean beanParam;
    private String stringParam;
    private int intParam;
    private boolean booleanParam;
    private char charParam;
    private long longParam;
    private float floatParam;
    private double doubleParam;
    private short shortParam;
    private Object objectParam;
    private byte byteParam;

    @SMDMethod
    public void doSomethingPrimitives(String stringParam, int intParam, boolean booleanParam, char charParam,
            long longParam, float floatParam, double doubleParam, short shortParam, byte byteParam) {
        this.stringParam = stringParam;
        this.intParam = intParam;
        this.booleanParam = booleanParam;
        this.charParam = charParam;
        this.longParam = longParam;
        this.floatParam = floatParam;
        this.doubleParam = doubleParam;
        this.byteParam = byteParam;
        this.shortParam = shortParam;
    }

    @SuppressWarnings("unchecked")
    @SMDMethod
    public void doSomethingObjects(Bean beanParam, Map mapParam, List listParam) {
        this.beanParam = beanParam;
        this.mapParam = mapParam;
        this.listParam = listParam;
    }

    @SMDMethod
    public void add(int a, int b) {
        this.addWasCalled = true;
    }

    @SMDMethod
    public void doSomething() {

    }

    public void methodWithoutAnnotation() {

    }

    public boolean isAddWasCalled() {
        return this.addWasCalled;
    }

    public void setAddWasCalled(boolean addWasCalled) {
        this.addWasCalled = addWasCalled;
    }

    @SuppressWarnings("unchecked")
    public List getListParam() {
        return this.listParam;
    }

    @SuppressWarnings("unchecked")
    public void setListParam(List listParam) {
        this.listParam = listParam;
    }

    @SuppressWarnings("unchecked")
    public Map getMapParam() {
        return this.mapParam;
    }

    @SuppressWarnings("unchecked")
    public void setMapParam(Map mapParam) {
        this.mapParam = mapParam;
    }

    public Bean getBeanParam() {
        return this.beanParam;
    }

    public void setBeanParam(Bean beanParam) {
        this.beanParam = beanParam;
    }

    public String getStringParam() {
        return this.stringParam;
    }

    public void setStringParam(String stringParam) {
        this.stringParam = stringParam;
    }

    public int getIntParam() {
        return this.intParam;
    }

    public void setIntParam(int intParam) {
        this.intParam = intParam;
    }

    public boolean isBooleanParam() {
        return this.booleanParam;
    }

    public void setBooleanParam(boolean booleanParam) {
        this.booleanParam = booleanParam;
    }

    public char getCharParam() {
        return this.charParam;
    }

    public void setCharParam(char charParam) {
        this.charParam = charParam;
    }

    public long getLongParam() {
        return this.longParam;
    }

    public void setLongParam(long longParam) {
        this.longParam = longParam;
    }

    public float getFloatParam() {
        return this.floatParam;
    }

    public void setFloatParam(float floatParam) {
        this.floatParam = floatParam;
    }

    public double getDoubleParam() {
        return this.doubleParam;
    }

    public void setDoubleParam(double doubleParam) {
        this.doubleParam = doubleParam;
    }

    public Object getObjectParam() {
        return this.objectParam;
    }

    public void setObjectParam(Object objectParam) {
        this.objectParam = objectParam;
    }

    public byte getByteParam() {
        return this.byteParam;
    }

    public void setByteParam(byte byteParam) {
        this.byteParam = byteParam;
    }

    public short getShortParam() {
        return this.shortParam;
    }

    public void setShortParam(short shortParam) {
        this.shortParam = shortParam;
    }
}

Other Struts examples (source code examples)

Here is a short list of links related to this Struts SMDActionTest1.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.