开启两个tomat—mvn 用法—HttpURLConnection用法
1 开启两个tomcat方法
只需要改四个端口
8080 ==8081
8005 == 8006
8009==8010
8443==8444
2 maven
Mvn jar:jar Mvn打包
Mvn site mvn生成api ,不过只对了一次
3 HttpURLConnection 用法
HttpURLConnection httpConn = null;
OutputStream stream = null;
try {
String urlString = "http://" + abc
URL url = new URL(urlString);
httpConn = (HttpURLConnection)url.openConnection();
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setRequestProperty("Content-Type","multipart/form-data");
httpConn.setRequestProperty("Content-length",
String.valueOf(abc);
httpConn.setRequestProperty("FileGroup", ddd);
httpConn.setRequestProperty("FileType", tyssspe);
httpConn.setRequestProperty("UploadType", "UPDATE");
httpConn.setRequestProperty("FileName", name);
httpConn.setRequestProperty("UserName", ddd);
httpConn.setRequestProperty("SpecialFolderPath","");
stream = httpConn.getOutputStream();
stream.write(dd, 0, dd.length);
stream.flush();
int code = httpConn.getResponseCode();
stream.close();
httpConn.disconnect();
httpConn = null;
stream = null;
if (code != 200) {
throw newException("upload failded");
}