Maicoly Morocho
Maicoly Morocho

Reputation: 159

<p:graphicImage> shows the same photo in .xhtml page

I have a Web Service (Rest) that returns a object type SERVIDOR depending on the ID

@GET
@Path("emps")
@Produces("application/xml")
public List <SERVIDOR> sendFoto(@QueryParam("a") String a)

and from another application I get this object, but when I like show the photo, It's shows the same photo all the time, even if I change the id.

getRestServidor() method:

      GenericType<List<SERVIDOR>> generic = new GenericType<List<SERVIDOR>>() {};
      System.out.println("Output from Server .... \n");
      this.setEmployee(response.getEntity(generic));
      for(SERVIDOR c:this.getEmployee()){
          this.setIs(new ByteArrayInputStream((byte[]) c.getNUEVA_FOTO()));
          this.setMyImage(new DefaultStreamedContent(this.getIs(), "image/png"));
      }

JSF Page:

 /*code*/
<p:commandButton value="Enviar" actionListener="#{paramReportController.checkBiometrico}" styleClass="ui-priority-primary"  update=":f1:growl2 :f1:pn1 :f1:png1 :f1:pn2"/>
        <div class="grid-example col s12 m6">
           <p:panel id="pn2">
              <p:panelGrid columns="2">
                <p:graphicImage value="#{paramReportController.myImage}"    alt="sin imagen" id="pic1" style="width:200px;width:200px">
                </p:graphicImage>
             </p:panelGrid>
          </p:panel>
/*code*/

Also, I have to say that to get to the getRestServidor() method, first it goes through another method called checkBiometrico() and it calls the getRestServidor().

HELP ME pleaseeee!!!!

Upvotes: 0

Views: 165

Answers (0)

Related Questions