Package org.jiaplee.beans

Examples of org.jiaplee.beans.Image


    System.out.println(this.fileName);
    System.out.println(this.contentType);
    System.out.println(this.caption);
    System.out.println(imageService);
    //实例化
    Image i = new Image();
    i.setId(fileName.hashCode());
    i.setFileName(fileName);
    i.setCaption(caption);
    try {
      i.setImage(FileUtils.readFileToByteArray(upload));
    } catch (IOException e) {
      e.printStackTrace();
    }
    // 保存数据
    this.serializable = imageService.save(i);
View Full Code Here


public class ShowImageAction extends ActionSupport {
  @Override
  public String execute() throws Exception {
    //从数据库get 刚上传的图片
    Image image = imageDao.getImage(serializable);
    //  使用 ByteArrayInputStream  将 二进制文件以流形式给页面
    this.imageStream = new ByteArrayInputStream(image.getImage());
    return SUCCESS;
  }
View Full Code Here

TOP

Related Classes of org.jiaplee.beans.Image

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.