首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

JeeCms自定义搜索(非Lucene形式)

2014-05-14 
JeeCms自定义搜索(非Lucene方式)@Autowiredprivate CmsStatisticSvc cm

JeeCms自定义搜索(非Lucene方式)
<bean id="searchAct" name="code">@Autowiredprivate CmsStatisticSvc cmsStatisticSvc;@RequestMapping(value = "/mySearch*.jspx", method = RequestMethod.GET)public String mySearch(HttpServletRequest request,HttpServletResponse response, ModelMap model,Integer pageNo) {CmsSite site = CmsUtils.getSite(request);// 将request中所有参数保存至model中。model.putAll(RequestUtils.getQueryParams(request));FrontUtils.frontData(request, model, site);FrontUtils.frontPageData(request, model);String q = RequestUtils.getQueryParam(request, "q");String channelId = RequestUtils.getQueryParam(request, "channelId");String city = RequestUtils.getQueryParam(request, "city");String town = RequestUtils.getQueryParam(request, "town");Pagination p = this.cmsStatisticSvc.mySearch(city, town, pageNo, Integer.valueOf(CookieUtils.getPageSize(request)), site.getId(), q.trim()); model.addAttribute("pagination", p); model.addAttribute("q", q); model.addAttribute("city", city); model.addAttribute("town", town); model.addAttribute("pageNo", pageNo); return FrontUtils.getTplPath(request, site.getSolutionPath(), "special", "tpl.myquery");}

?在CmsStatisticSvc及其实现类中实现mySearch(String city,String ?town, Integer pageNo, Interger pageSize, Interger siteId, String ?q);方法,在CmsStatisticSvc中为注入的CmsStatisticDao及其实现类实现mySearch()方法。

热点排行