- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个带有以下 ActionForm 的 Struts 1 应用程序:
import org.apache.struts.upload.FormFile;
public class uploadedFileForm {
public FormFile theFile;
public FormFile getTheFile() {
return theFile;
}
public void setTheFile(FormFile theFile) {
this.theFile = theFile;
}
}
我的 JSP 页面具有以下形式:
<html:form action="/myAction" enctype="multipart/form-data">
<html:file property="theFile" onkeypress="return false;" />
</html:form>
当我将表单提交到 Struts 操作时,我立即收到以下错误消息:
org.apache.commons.beanutils.ConversionException: Could not convert java.lang.String to org.apache.struts.upload.FormFile
我尝试在操作的开头添加一些调试语句,但没有一个打印出来。这似乎表明 Struts 在执行我的操作之前抛出了此错误。
有人对可能导致此错误消息的原因有任何建议吗?
最佳答案
该问题与 <html:form>
有关标签。
两者method="post"
和enctype="multipart/form-data"
标签上需要属性。
我的实际表单更复杂,没有 enctype="multipart/form-data"
属性(property)。当我添加它时,一切正常。
关于java - FormFile 抛出 ConversionException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2299380/
我有一个带有以下 ActionForm 的 Struts 1 应用程序: import org.apache.struts.upload.FormFile; public class uploaded
我遇到了问题 OntClass.listSubClasses 。我在循环中使用此方法,在给定点之前它工作正常: for(Iterator i = class.listSubClasses() ; i.
我有一个特定的类 URI,我正在尝试为其获取 OntClass。该模型是常规模型。 我写了一些代码来找出模型中是否有正确的语句,似乎它们是,所以我无法理解为什么它不会让我将其视为 OntClass。
我收到以下耶拿指定个人异常(exception): Cannot convert node http://www.w3.org/2002/07/owl#NamedIndividual to OntCl
我正在尝试在 Android 应用程序中使用 XStream 从 XML 文件读取 TreeMap(我之前也使用 XStream 创建了 XML 文件)。 我只是在类的静态方法中执行此操作 File
我想将模型中的枚举值绑定(bind)到 ComboBox。我尝试了什么: 型号: public class Model{ public enum Status { Neu, Analy
[已编辑] 我正在处理的项目是一个 Java J2EE 中的 3 个文件夹项目,带有 servlet 和 Hibernate 以实现持久性。结构如下: - Admin -> 主程序,包含 beans
我正在尝试解析 XML 文档,这是文档的结构 Lily Brown
我在使用 OVAL 验证框架处理 XML 文件时遇到异常。我正在使用 OVAL 验证框架进行验证。我遵循了网站上记录的用户指南。 http://oval.sourceforge.net/usergui
我正在尝试将请求发送到 drools 执行服务器。这是请求 I don't know 2464 12345 200 400000 1993 7 3 -2147483648 -2147
我正在运行我的脚本,它挂了,我不得不强行关闭。 现在出现这个错误: 最佳答案 从下载“Plugins-manager.jar” https://jmeter-plugins.org/downloads
我需要使用 XStream 1.4.4 将一堆 XML 读入 Java 域模型。我使用 JAXB 从 XSD 生成域类,用看似合适的 @XSteeamAlias 替换了一些注释(尽管到目前为止似乎没有
我正在尝试对一些 json 使用 retro fit,但看不到我的 json 字符串有什么问题,我不断收到同样的错误。 我期待一个单词对象列表,但我错过了什么?有什么想法吗? retrofit.con
当尝试使用 PowerMockRule technique 组合 Spring 测试运行器和 PowerMock 运行器时,每当我尝试使用 JPA 中的 PersistenceContext 注释注入
当我尝试将 XML 负载分配给 java 对象时,我收到了 ConversionException。我想做的就是将名称列表放入作为 DTO 一部分的 List 对象中。有人可以帮我解决这个问题吗?我看
我已将 jmeter 脚本与 Maven 集成。我也有 jmeter 插件管理器。运行它时,我收到 java.lang.IllegalArgumentException ,这导致了上述异常。我已经添加
我正在尝试在 Java 实体类中获取表记录,其中一列被定义为 CLOB。当我执行选择查询时,出现以下错误:- [EclipseLink-3002](Eclipse 持久性服务 - 2.6.2.qual
我是一名优秀的程序员,十分优秀!