show on image component blob image

asked 2014-03-21 00:19:32 +0800

vljc2004 gravatar image vljc2004
1 2

updated 2014-03-21 12:17:57 +0800


I´m need show a image on image that is a Blob . I´m have a table when yo do click on data open an window and in this window I need show a image.


public class ...

public final void doAfterCompose(final Component comp) throws Exception {

 .... do actions to load data into table
 .... listener table

 public final void onEvent(final Event event) throws Exception {
  //Load object with data like name, type and BLOB IMAGE
  final MyEmp me = (MyEmp) empList.getData();
  //Private method to send information to view
 private void mData(final MyEmp me) throws IOException {

    final Map<String,Object> args = new HashMap<String,Object>();

    // Get from object
    byte[] data = me.getImage();
    // Convert to image
    AImage img = new AImage("img.jpg", data);
    System.out.println( img.getName()+" "+img.getHeight() );

    //Map to send view
    args.put("test", me);
    // I´m tryng with img, img.getName(), img.getStringData()
    args.put("myimg",img );
    //special method to open window
    oWind("/ct/edit.zul","Edit", args,

My view edit.zul

  <cell colspan="2">
   <image id="logo" src="@{winEditEmp$composer.myimg}" />

Every data is load fine except my image, only show me the path class controller.

If I´m review the header information on browser show this:

Request    URL:...localhost/mytestsite/[email protected]
Request Method:GET
Status Code:404 Not Found
Request Headersview source
delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2014-03-21 00:19:32 +0800

Seen: 20 times

Last updated: Mar 21 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More