资源简介
Java实现网路爬虫爬取新闻信息,运用了正则匹配,后台使用Spring+SpringMVC+Mybatis+Mysql
代码片段和文件信息
package com.ssm.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.ssm.service.NewsService;
@Controller
public class NewsController {
@Autowired
private NewsService newsService;
@RequestMapping(“/home“)
public String home() {
return “home“;
}
@RequestMapping(value = “/findPageNews/{pageId}“ method = RequestMethod.GET)
public ModelAndView findPageNews(@PathVariable(“pageId“) int pageId)
throws Exception {
String json = newsService.findPageNews(pageId);
ModelAndView modelAndView = new ModelAndView();
modelAndView.addobject(“json“ json);
modelAndView.setViewName(“home“);
System.out.println(json);
return modelAndView;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 841 2016-07-22 09:26 SCU_News_Notice\.classpath
文件 1048 2016-07-22 09:26 SCU_News_Notice\.project
文件 503 2016-07-22 09:26 SCU_News_Notice\.settings\.jsdtscope
文件 199 2016-07-27 17:24 SCU_News_Notice\.settings\org.eclipse.core.resources.prefs
文件 364 2016-07-22 09:26 SCU_News_Notice\.settings\org.eclipse.jdt.core.prefs
文件 497 2016-07-22 09:26 SCU_News_Notice\.settings\org.eclipse.wst.common.component
文件 345 2016-07-22 09:26 SCU_News_Notice\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2016-07-22 09:26 SCU_News_Notice\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2016-07-22 09:26 SCU_News_Notice\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 1172 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\controller\converter\CustomDateConverter.class
文件 1799 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\controller\NewsController.class
文件 122 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\mapper\AcademyMapper.class
文件 615 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\mapper\NewsMapper.class
文件 1819 2016-07-26 11:14 SCU_News_Notice\build\classes\com\ssm\mapper\NewsMapper.xm
文件 120 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\mapper\NoticeMapper.class
文件 711 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\po\Academy.class
文件 1707 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\po\News.class
文件 1349 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\po\Notice.class
文件 2080 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\service\impl\NewsServiceImpl.class
文件 618 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\service\NewsService.class
文件 7809 2016-07-28 10:57 SCU_News_Notice\build\classes\com\ssm\service\task\Spider.class
文件 1309 2016-07-26 11:47 SCU_News_Notice\build\classes\com\ssm\utils\EncoderUtil.class
文件 1686 2016-07-26 15:29 SCU_News_Notice\build\classes\com\ssm\utils\FileUtil.class
文件 3850 2016-07-27 17:24 SCU_News_Notice\build\classes\com\ssm\utils\HttpUtil.class
文件 4179 2016-07-26 11:47 SCU_News_Notice\build\classes\test\dao\MyBatisDao.class
文件 585 2016-07-24 12:04 SCU_News_Notice\src\com\ssm\controller\converter\CustomDateConverter.java
文件 1016 2016-07-24 15:36 SCU_News_Notice\src\com\ssm\controller\NewsController.java
文件 66 2016-07-22 09:31 SCU_News_Notice\src\com\ssm\mapper\AcademyMapper.java
文件 659 2016-07-24 12:14 SCU_News_Notice\src\com\ssm\mapper\NewsMapper.java
文件 1819 2016-07-26 11:14 SCU_News_Notice\src\com\ssm\mapper\NewsMapper.xm
............此处省略497个文件信息
评论
共有 条评论