public void fatalProtocolException( HttpException ex, NHttpConnection conn) { // System.out.println("fatalProtocolException:" + conn); ex.printStackTrace(); }
public void fatalProtocolException( HttpException ex, NHttpConnection conn) { // System.out.println("fatalProtocolException:" + conn); ex.printStackTrace(); }
httpUtils.send(HttpMethod.GET, GlobalConstans.SERVER_URL+url, new RequestCallBack<String>() { @Override public void onSuccess(ResponseInfo<String> responseInfo) { String resultJson = responseInfo.result; setJson(resultJson); initTopicNewsImages(); //CALLING FROM HERE. Log.d("*************************",json); //CacheUtils.setCache(GlobalConstans.CATEGORY_URL,result,getActivity()); processData(json); } @Override public void onFailure(HttpException e, String s) { e.printStackTrace(); Log.d("Fail","fail"); Toast.makeText(getActivity(),"Failure", Toast.LENGTH_SHORT).show(); } });
try { QueryExecution qe = query(string); } catch (HttpException ex) { System.out.println (ex.getMessage()); //Optional ex.printStackTrace(); //Optional }
public static Map<String,String> aizhanIcp(String domain){ HashMap<String, String> map = new HashMap<>(); HttpClient httpClient = new HttpClient(); String url = "https://icp.aizhan.com/%s/"; try { ResponseStatus responseStatus = httpClient.get(String.format(url, domain)); String html = responseStatus.getContent(); if (!html.contains("未找到") && html.contains("该单位备案网站") && html.contains("缓存于")) { Document doc = Jsoup.parse(html); Elements trs = doc.select("div#company .table-s1 tbody tr"); for (Element tr : trs) { String title = tr.select("td").get(1).text(); String dom = tr.select("td").get(2).text(); map.put(dom,title); } } } catch (HttpException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } SysLog.info("ICP反查结束"); return map; }
e.printStackTrace(); Thread.sleep(500); } finally {
e.printStackTrace(); } catch (IOException e) { e.printStackTrace();
e.printStackTrace(); interrupted();
e.printStackTrace(); interrupted();
e.printStackTrace(); return arr; } catch (IOException e) {