Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/149.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java <;s:fileUpload>;正在返回空值_Java_Seam_Seam2 - Fatal编程技术网

Java <;s:fileUpload>;正在返回空值

Java <;s:fileUpload>;正在返回空值,java,seam,seam2,Java,Seam,Seam2,使用执行文件上载时,组件将返回null 应用程序正在使用seam 2.1.2与Richfaces、Jsf集成 <h:panelGrid columns="2" cellspacing="1" cellpadding="0" columnClasses="columnFull"> <s:fileUpload id="picture" data="#{image.uploadedFile}" contentType="#{image.pictureContentTy

使用
执行文件上载时,组件将返回null

应用程序正在使用seam 2.1.2与Richfaces、Jsf集成

<h:panelGrid columns="2" cellspacing="1" cellpadding="0"
   columnClasses="columnFull">
<s:fileUpload id="picture" data="#{image.uploadedFile}"

    contentType="#{image.pictureContentType}" />

</h:panelGrid>


@Name("image")
@Scope(ScopeType.CONVERSATION)
public class DoImportServiceUpload {


      @Lob
      @Column(length = 2147483647)
      private  byte[] uploadedFile;

      private String pictureContentType;

@名称(“图像”)
@作用域(ScopeType.CONVERSATION)
公共类DoImportServiceUpload{
@高球
@列(长度=2147483647)
私有字节[]上传文件;
私有字符串pictureContentType;
}

web.xml

<filter>
  <filter-name>Seam Filter</filter-name>
  <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
</filter>
  <filter-mapping>
  <filter-name>Seam Filter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>

接缝过滤器
org.jboss.seam.servlet.SeamFilter
接缝过滤器
/*
components.xml

<web:multipart-filter create-temp-files="true"
                      max-request-size="1000000" 
                      url-pattern="*.seam" />

  • 在Seam MultiPartFilter中放置断点。使用远程调试连接到应用程序服务器。检查筛选器是否已实际启动,以及是否找到文件上载
  • 如果不是,文件上载可能不在POST请求中。在Google Chrome中检查文件上传是否使用正确的内容类型发送
  • 检查
    s:fileUpload
    标记是否实际包含在单个
    h:form
    中。
    h:form
    应为
    类型。检查在HTML输出中是否也正确呈现了此内容

  • 你能发布嵌入
    的表单吗?是
    还是