java中调用web中的jsp或servlet去通知它们做一些操作
java中调用web中的jsp或servlet去通知它们做一些操作,这里可以返回远程流(参考:下载远程文件例子),
或者仅仅通知,如下
try
{
String url = "http://ip:port/myweb/test/getInterface.jsp";
URL portalUrl = new URL(url);
HttpURLConnection urlConnection = (HttpURLConnection)portalUrl.openConnection();
urlConnection.setRequestMethod("POST");
urlConnection.connect();
urlConnection.getInputStream();
System.out.println("notice mywebto reread config!");
}
catch (Exception e)
{
e.printStackTrace();
}