title: From blob to image with struts2 and InputStream
body: <p>I would to know why I don't get anything with this. I have a function who return a byte array from SQL Server 2008 but I don't get anything, why? .getWhiteLabelingLogo() is a function which returns a byte[] with the image which I want to show at the jsp page. I access to this 
  
  <pre><code>import java.io.BufferedInputStream;
  import java.io.ByteArrayInputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.rmi.RemoteException;
  import java.util.Map;
  
  import javax.servlet.http.HttpServletResponse;
  
  import org.apache.axis.MessageContext;
  import org.apache.struts2.ServletActionContext;
  import org.datacontract.schemas._2004._07.CCIS_Web_Services_PublicApi.PapiAccountInfo;
  import org.datacontract.schemas._2004._07.CCIS_Web_Services_PublicApi.PapiUserInfo;
  
  import Services.Web.CCIS.BasicHttpBinding_PublicApiServiceStub;
  import Services.Web.CCIS.PublicApiService_PortType;
  
  import com.opensymphony.xwork2.ActionContext;
  import com.opensymphony.xwork2.ActionSupport;
  
  public class ShowImageAction extends ActionSupport{
    Map session;
   private byte[] itemImage; 
   private InputStream str = null;
  public String execute() throws RemoteException { 
      System.out.println("Estoy aquí");
          HttpServletResponse response = ServletActionContext.getResponse(); 
  
  
     session = ActionContext.getContext().getSession();
     PublicApiService_PortType puerto=(PublicApiService_PortType) session.get("puerto");
     ((BasicHttpBinding_PublicApiServiceStub)puerto).setMaintainSession(true);
  
     MessageContext ctx=(MessageContext) session.get("contexto");
     PapiUserInfo[] users;
  
      users = puerto.getUsers();
      Long accountID=users[0].getID();
      PapiAccountInfo info=puerto.getAccountInfo(accountID);
              itemImage=info.getWhiteLabelingLogo();
              str=new ByteArrayInputStream(itemImage);
          return SUCCESS;
  
  
  
  
  }
  
    public void setItemImage(byte[] itemImage) { 
        this.itemImage = itemImage; 
     }
  
     public InputStream getStr() {
      return str;
     }
  
     public void setStr(InputStream str) {
      this.str = str;
     }
  
     public byte[] getItemImage() {
      return itemImage;
     } 
  
  
    }
  </code></pre>
  
  <p>at index.jsp I have this:</p>
  
  <pre><code>&lt;img src="&lt;s:url value="ShowImageAction" /&gt;" border="0" width="100" height="100"&gt; 
  </code></pre>
  
  <p>And in struts.xml I have this:</p>
  
  <pre><code> &lt;action name="ShowImageAction"&gt;
    &lt;result name="success" type="stream"&gt;
      &lt;param name="inputName"&gt;str&lt;/param&gt;
      &lt;param name="contentType"&gt;image/jpeg&lt;/param&gt;
  
   &lt;/result&gt;
  &lt;/action&gt;
  </code></pre>
  
  <p>What I'm doing bad because I haven't anything. Thanks so much</p>