Home » struts-2.1.8.1-src » org.apache » struts2 » showcase » ajax » [javadoc | source]

    1   /*
    2    * $Id: Example4ShowPanelAction.java 471756 2006-11-06 15:01:43Z husted $
    3    *
    4    * Licensed to the Apache Software Foundation (ASF) under one
    5    * or more contributor license agreements.  See the NOTICE file
    6    * distributed with this work for additional information
    7    * regarding copyright ownership.  The ASF licenses this file
    8    * to you under the Apache License, Version 2.0 (the
    9    * "License"); you may not use this file except in compliance
   10    * with the License.  You may obtain a copy of the License at
   11    *
   12    *  http://www.apache.org/licenses/LICENSE-2.0
   13    *
   14    * Unless required by applicable law or agreed to in writing,
   15    * software distributed under the License is distributed on an
   16    * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   17    * KIND, either express or implied.  See the License for the
   18    * specific language governing permissions and limitations
   19    * under the License.
   20    */
   21   package org.apache.struts2.showcase.ajax;
   22   
   23   import java.text.SimpleDateFormat;
   24   import java.util.Date;
   25   
   26   import com.opensymphony.xwork2.ActionSupport;
   27   
   28   /**
   29    * @version $Date: 2006-11-06 10:01:43 -0500 (Mon, 06 Nov 2006) $ $Id: Example4ShowPanelAction.java 471756 2006-11-06 15:01:43Z husted $
   30    */
   31   public class Example4ShowPanelAction extends ActionSupport {
   32   
   33       private String name;
   34       private String gender;
   35   
   36       private static final long serialVersionUID = 7751976335066456596L;
   37   
   38       public String panel1() throws Exception {
   39           return SUCCESS;
   40       }
   41   
   42       public String panel2() throws Exception {
   43           return SUCCESS;
   44       }
   45   
   46       public String panel3() throws Exception {
   47           return SUCCESS;
   48       }
   49   
   50       public String getGender() {
   51           return gender;
   52       }
   53   
   54       public void setGender(String gender) {
   55           this.gender = gender;
   56       }
   57   
   58       public String getName() {
   59           return name;
   60       }
   61   
   62       public void setName(String name) {
   63           this.name = name;
   64       }
   65   
   66       public String getTodayDate() {
   67           SimpleDateFormat sdf = new SimpleDateFormat("dd-MMMM-yyyy");
   68           return sdf.format(new Date());
   69       }
   70   
   71       public String getTodayTime() {
   72           SimpleDateFormat sdf = new SimpleDateFormat("kk:mm:ss");
   73           return sdf.format(new Date());
   74       }
   75   }

Home » struts-2.1.8.1-src » org.apache » struts2 » showcase » ajax » [javadoc | source]