0

SERVIDOR我有一个 Web 服务(Rest),它根据 ID返回一个对象类型

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

从另一个应用程序我得到这个对象,但是当我喜欢显示照片时,它一直显示同一张照片,即使我更改了 ID。

getRestServidor()方法:

      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 页面:

 /*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*/

另外,我不得不说,要获得该getRestServidor()方法,首先它会通过另一个名为checkBiometrico()的方法并调用getRestServidor().

请帮帮我!!!!

4

0 回答 0