在我的网络应用程序中,客户端 ping 服务器(尝试联系服务器上的 ping servlet),servlet 的地址/资源定位器是:
"192.168.43.187/server/ping?" + new ClientAddress().getNetworkIP();
到目前为止,客户端每次 ping 时都会将其网络 IP 发送到服务器。我想用这个 URL 添加另一条信息,即 new GregorianCalendar().getTimeInMillis();
。
我如何发送这个?
注意:
在 URL 中,ping 是一个 servlet
最佳答案
"192.168.43.187/server/ping?ip=" + new ClientAddress().getNetworkIP() +
"&time=" + new GregorianCalendar().getTimeInMillis();
您需要更改“ping”servlet 才能读取这些参数。
关于java - 向 servlet 发送第二个查询参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13856648/