小编Raj*_*lly的帖子

在宁静的Web服务中下载文件

我的要求是,我应该向客户发送一个10MB的zip文件,并提供宁静的服务.我在论坛中发现发送StreamingOutput对象的代码是更好的方法,但是如何StreamingOutput在以下代码中创建对象:

@Path("PDF-file.pdf/")
@GET
@Produces({"application/pdf"})
public StreamingOutput getPDF() throws Exception {
  return new StreamingOutput() {
     public void write(OutputStream output) throws IOException, WebApplicationException      
     {
        try {
            //------
        } catch (Exception e) {
            throw new WebApplicationException(e);
        }
     }
  };
}
Run Code Online (Sandbox Code Playgroud)

java rest

19
推荐指数
1
解决办法
8万
查看次数

无法在端口7777上设置本地SOCKS5代理:已在使用的地址:JVM_Bind

同时将来自火花中的代理人的消息发送给客户端应用程序中的客户端

我得到以下错误

无法在端口7777上设置本地SOCKS5代理:已在使用的地址:JVM_Bind

我写的用于向客户发送消息的代码是..吼叫..

我在类中编写了以下方法,实现了org.jivesoftware.smackx.workgroup.agent.OfferListener

Message message1 = new Message();
message1.setBody(message);
try {
for (MultiUserChat muc : GlobalUtils.getMultiuserchat()) {
   if (muc.getRoom().equals(conf)) {
      muc.sendMessage(message1);
      System.out.println("message sent  ############# agent to client..");
   }
}

} catch (Exception ex) {
    System.out.println("exception while sending message in sendMessage() ");
    ex.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

帮我

谢谢rajesh.v

openfire

2
推荐指数
1
解决办法
3581
查看次数

标签 统计

java ×1

openfire ×1

rest ×1