package com.esp.actionform;import org.apache.struts.action.*;
import java.util.*;
import javax.servlet.http.*;public class IndexActionForm
extends ActionForm
{
private Vector docTypeIds = new Vector();
private Vector fieldNames = new Vector();
private Vector fieldTypeNames = new Vector();
private String fieldValue = "where [Item No#] like '%C%'";
private String selectedDocType;
private Vector docTypeNames = new Vector();
public Vector getDocTypeIds()
{
return docTypeIds;
} public void setDocTypeIds(Vector docTypeIds)
{
this.docTypeIds = docTypeIds;
} public Vector getFieldNames()
{
return fieldNames;
} public void setFieldNames(Vector fieldNames)
{
this.fieldNames = fieldNames;
} public void setFieldTypeNames(Vector fieldTypeNames)
{
this.fieldTypeNames = fieldTypeNames;
} public String getFieldValue()
{
return fieldValue;
} public void setFieldValue(String fieldValue)
{
this.fieldValue = fieldValue;
} public String getSelectedDocType()
{
return selectedDocType;
} public Vector getDocTypeNames()
{
return docTypeNames;
} public Vector getFieldTypeNames()
{
return fieldTypeNames;
} public void setSelectedDocType(String selectedDocType)
{
this.selectedDocType = selectedDocType;
} public void setDocTypeNames(Vector docTypeNames)
{
this.docTypeNames = docTypeNames;
} public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest)
{
ActionErrors errors = new ActionErrors(); return errors; } public void reset(ActionMapping actionMapping,
HttpServletRequest httpServletRequest)
{ }
}
import java.util.*;
import javax.servlet.http.*;public class IndexActionForm
extends ActionForm
{
private Vector docTypeIds = new Vector();
private Vector fieldNames = new Vector();
private Vector fieldTypeNames = new Vector();
private String fieldValue = "where [Item No#] like '%C%'";
private String selectedDocType;
private Vector docTypeNames = new Vector();
public Vector getDocTypeIds()
{
return docTypeIds;
} public void setDocTypeIds(Vector docTypeIds)
{
this.docTypeIds = docTypeIds;
} public Vector getFieldNames()
{
return fieldNames;
} public void setFieldNames(Vector fieldNames)
{
this.fieldNames = fieldNames;
} public void setFieldTypeNames(Vector fieldTypeNames)
{
this.fieldTypeNames = fieldTypeNames;
} public String getFieldValue()
{
return fieldValue;
} public void setFieldValue(String fieldValue)
{
this.fieldValue = fieldValue;
} public String getSelectedDocType()
{
return selectedDocType;
} public Vector getDocTypeNames()
{
return docTypeNames;
} public Vector getFieldTypeNames()
{
return fieldTypeNames;
} public void setSelectedDocType(String selectedDocType)
{
this.selectedDocType = selectedDocType;
} public void setDocTypeNames(Vector docTypeNames)
{
this.docTypeNames = docTypeNames;
} public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest)
{
ActionErrors errors = new ActionErrors(); return errors; } public void reset(ActionMapping actionMapping,
HttpServletRequest httpServletRequest)
{ }
}
解决方案 »
- jnid lookupLink()的例子
- 快逸报表参数问题!急!!
- 网页怎样展示和制作流程图?
- 帮____wo,给我一个思路,我能撑起整个银河!
- jboss3.2.2怎么进行安环境环境的配置呀,不是整合tomcat的
- 求tomcat整合hibernate的详细步骤
- 怎样通过webservice实现下载文件?100分
- 是否只有正在使用的jdk目录下的\jre\lib下面的jar文件里包含着的类才可直接使用,除此之外所用类都必须写在classpath里
- 谁有 struts项目的原代码?
- the method is undefined in the arrays values = Arrays.copyOf(values, values.leng
- Axis初级问题
- J2EE连接AccessXP的问题
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %><html:html locale="true">
<head>
<title><bean:message key="title"/></title>
</head>
<script language="JavaScript" src="js/function.js"> </script><body>
<html:errors/>
<html:form action="mainAction.do">
<center>
<table border="0">
<tr>
<td><bean:message key="index.field"/></td>
<td>
<html:select property="fieldNames" size="10" style="width:120px">
<html:options property="fieldNames" labelProperty="fieldNames"/>
</html:select> </td>
<td><bean:message key="index.fieldtype"/></td>
<td>
<html:select property="fieldTypeNames" style="width:120px" size="10">
<html:options property="fieldTypeNames" labelProperty="fieldTypeNames"></html:options>
</html:select>
</td>
</tr> <tr>
<td height="18"><bean:message key="index.condition"/></td>
<td colspan="3">
<html:text property="fieldValue" style="width:300px"/>
</td>
</tr> <tr>
<td><bean:message key="index.doctype"/>
</td>
<td>
<html:select property="docTypeIds" style="width:120px" size="10">
<html:options property="docTypeIds" labelProperty="docTypeNames"></html:options>
</html:select>
</td>
<td>
<html:button property="select" onclick="javascript:movea('docTypeIds','selectedDocType');"><bean:message key="index.button"/></html:button>
</td>
<td>
<html:select property="selectedDocType" style="width:120px" size="2"></html:select>
</td> </tr> <tr>
<td colspan="4" align="middle">
<html:submit>
<bean:message key="index.submit"/>
</html:submit> </td>
</tr>
</table>
</center>
</html:form></body>
</html:html>
HttpServletRequest httpServletRequest)
{ }
}
中初始化一下啊
<html:select property="docTypeIds" style="width:120px" size="10">
<html:options property="docTypeIds" labelProperty="docTypeNames"></html:options>
</html:select>
select的结果肯定是一个固定值,所以应该返回一个String,而你在property里用的一个vector去接,当然会出错了,你应该在form里定义一个String docTypeid及他们get,set方法,然后
<html:select property="docTypeId" style="width:120px" size="10">
<html:options property="docTypeIds" labelProperty="docTypeNames"></html:options>
</html:select>
这样就对了,其他的html:select也是同样的错误.
写了一大堆,不知道你明白我的意思没有.