标签:重启tomcat应用 重启tomcat服务 java操作tomcat
重启Tomcat应用:
public String reloadApp(){ String url="http://localhost:1081/manager/reload?path=/app"; return remoteLogin(url,"admin", "admin"); } public String remoteLogin(String url,String username,String password){ HttpClient client = new HttpClient( ); HttpMethod method = new GetMethod( url ); Credentials credentials = new UsernamePasswordCredentials( username,password ); client.getState().setCredentials( null, null, credentials ); try { client.executeMethod( method ); String response = method.getResponseBodyAsString( ); method.releaseConnection( ); return response; } catch (HttpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return "请示失败"; }
未完,待续…………
标签:重启tomcat应用 重启tomcat服务 java操作tomcat
原文地址:http://blog.csdn.net/ztt_1119/article/details/45076091