struts2.0与fckeditor 一起用时,图片不能上传

郁闷呀,最开始一只找不到原因。报错:error 203,List<FileItem> items = upload.parseRequest(request);返回的item的长度始终是零。最后终于找到原因:struts2对request进行了封装,所以当fck的request.getinputStream的时候就会出错.修改的方法就是对filtermapping的路径进行修改

 

<filter>   
        <filter-name>struts2</filter-name>   
        <filter-class>   
            org.apache.struts2.dispatcher.FilterDispatcher   
        </filter-class>   
    </filter>   
  
    <filter-mapping>   
        <filter-name>struts2</filter-name>   
        <url-pattern>*.action</url-pattern>   
    </filter-mapping>   
  
  
    <filter-mapping>   
        <filter-name>struts2</filter-name>   
        <url-pattern>*.jsp</url-pattern>   
    </filter-mapping>  

 

 

你可能感兴趣的:(apache,jsp,fckeditor)