当前位置: 代码迷 >> Java Web开发 >> 一个让人莫名其妙的有关问题-架构STRUTS,工具ECLIPSE
  详细解决方案

一个让人莫名其妙的有关问题-架构STRUTS,工具ECLIPSE

热度:213   发布时间:2016-04-17 13:30:01.0
一个让人莫名其妙的问题----------架构STRUTS,工具ECLIPSE
这是我的文件内容
ACTIONFORM内容:
/*
  *   Generated   by   MyEclipse   Struts
  *   Template   path:   templates/java/JavaClass.vtl
  */
package   cn.hxex.huge.struts.form;

import   java.util.*;
import   java.util.Map;
import   java.util.HashMap;
import   javax.servlet.http.HttpServletRequest;
import   org.apache.struts.action.ActionErrors;
import   org.apache.struts.action.ActionForm;
import   org.apache.struts.action.ActionMapping;

/**  
  *   MyEclipse   Struts
  *   Creation   date:   07-27-2007
  *  
  *   XDoclet   definition:
  *   @struts.form   name= "friendsForm "
  */
public   class   FriendsForm   extends   ActionForm   {
private   List   names   =   new   ArrayList();
private   List   addresses   =   new   ArrayList();
/*
  *   Generated   Methods
  */



/**  
  *   Method   validate
  *   @param   mapping
  *   @param   request
  *   @return   ActionErrors
  */
public   ActionErrors   validate(ActionMapping   mapping,
HttpServletRequest   request)   {
//   TODO   Auto-generated   method   stub
return   null;
}

/**  
  *   Method   reset
  *   @param   mapping
  *   @param   request
  */
public   void   reset(ActionMapping   mapping,   HttpServletRequest   request)   {
//   TODO   Auto-generated   method   stub
}
/**
  *   以LIST为单位,STE,GET该属性的值
  *   @return
  */
public   List   getAddresses()   {
return   addresses;
}

public   void   setAddresses(List   addresses)   {
this.addresses   =   addresses;
}

public   List   getNames()   {
return   names;
}

public   void   setNames(List   names)   {
this.names   =   names;
}
/**
  *   以LIST中单个值为单位,SET,GET该LIST的值
  *   @param   index
  *   @param   name
  */
public   void   setName(int   index,String   name){
if(this.names.size()   >   index)
this.names.add(index,   name);
else{
while(this.names.size()   <   index)
this.names.add(null);
this.names.add(index,name);
}
}
public   String   getName(int   index){
if(this.names.size()   <   index)
return   null;
else
return   (String)this.names.get(index);

}
public   void   setAddress(int   index,String   address){
if(this.addresses.size()   >   index)
this.addresses.add(index,   address);
else{
while(this.addresses.size()   <   index)
this.addresses.add(null);
this.addresses.add(index,   address);
}
}
public   String   getAddress(int   index){
if(this.addresses.size()   <   index)
return   null;
  相关解决方案