摘要: http://www.oschina.net/question/12_14127http://www.open-open.com/jsoup/selector-syntax.htm比如:可以用.body p查找在"body"元素下的所有p元素 阅读全文
posted @ 2012-09-26 22:35 _zao123 阅读(184) 评论(0) 推荐(0)
摘要: 1) redirect 方式 response.sendRedirect("/a.jsp"); 页面的路径是相对路径。sendRedirect可以将页面跳转到任何页面,不一定局限于本web应用中,如: response.sendRedirect("URL"); 跳转后浏览器地址栏变化。 这种方式要传值出去的话,只能在url中带parameter或者放在session中,无法使用request.setAttribute来传递。 2) forward方式 RequestDispatcher dispatcher = request.getRequestDis 阅读全文
posted @ 2012-09-26 15:25 _zao123 阅读(903) 评论(0) 推荐(0)
摘要: 今天在调试一段代码的时候,抛出异常java.util.ConcurrentModificationException,这个异常之前没怎么碰到过,抛错代码如下:private List<String> getShopLinkList(Elements elements) throws Exception { List<String> shopUrlList = new ArrayList<String>(); for(Element element :elements){ String parseLink = element.at... 阅读全文
posted @ 2012-09-26 15:22 _zao123 阅读(368) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { String url = "http://qiang.tmall.com/go/chn/qiang/cate-fushi.php"; String pattern = "[^//]*?\\.(com|cn|net|org|biz|info|cc|tv)" ; String pattern1 = "(?<=http://|\\.)[^.]*?\\.(com|cn|net|org|biz|info|cc|tv)" ; Pattern p = Pa... 阅读全文
posted @ 2012-09-26 15:05 _zao123 阅读(3932) 评论(0) 推荐(0)