我用JS获取<s:file>里的value获取不到
       我是要做一个<s:file>选择图片后   <img>直接就显示的那种
 
 
 
         求高手解决下。

解决方案 »

  1.   

    路径是不能取的,要进行预览,请采用下面的方法
    http://www.klstudio.com/post/182.html
    http://www.jb51.net/codes/27940.html
      

  2.   

    用JS不可用吗?  那个太复杂了。我是菜鸟啊。。那个是什么语言啊 flash?  和JAVA好像
      

  3.   

    java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) 
    .....这个错误怎么解决啊  说是堆栈问题   
    @ParentPackage("api")
    @Result(type="json",name="userinfo")
    public class UserinfoAction extends ActionSupport implements ServletContextAware{
    @Resource
    private UserinfoService userinfoService;
    @Resource
    private UtypeService utypeService;
    @Resource
    private CommerceService commerceService;
    @Resource
    private FriendgroupService friendgroupService;
    @Resource
    private CommercepositionService commercepositionService;
    @Resource
    private CommerceuserService commerceuserService; private Userinfo userinfo;
    private File uploadPic;
    private String useId;
    private File upload;
    private String uploadFileName; // 上传文件名
    private String uploadContentType; // 文件的内容类型
    private ServletContext context;
    private String place;
    private List<Userinfo> userList;
    private String username;
    private String industry;
    private String district;
    private int pageNum;
    private int pageSize;@Action(value="userinfo",results={@Result(type="json",name="aaa")}) 
    public String list(){ userList = userinfoService.getListByPage(username, industry, district, pageNum, pageSize);
    System.out.println(userList==null?"null":userList.size());
    return "aaa";
    }
    }