JSP页面做简单查询

框架:springmvc+mybatis

Java代码

@RequestMapping( method = { RequestMethod.POST, RequestMethod.GET } )
	public String getPartnerConsultList( @RequestParam( value = "page", defaultValue = "1" ) int pageNumber,
	        @RequestParam( value = "page.size", defaultValue = PageUtil.PAGE_SIZE ) int pageSize, Model model,
	        HttpServletRequest request ) {
			
		//根据页面传过来的数据转换成对象
		PageCondition pgc = ReflectionFromParamUtil.getPaginationObject( request, PartnerConsult.class );
		
		//根据条件查询数据库
		List partnerConsults = prConsultService.findByCondition( pgc.getObj(),
		    new PageBounds( pageNumber, pageSize ) );

		if( partnerConsults != null && partnerConsults.size() > 0 ) {
			PageList pageList = (PageList)partnerConsults;
			Paginator paginator = pageList.getPaginator();

			model.addAttribute( "pageList", pageList );
			model.addAttribute( "paginator", paginator );
		}

		model.addAttribute( "obj", pgc.getObj() );
		model.addAttribute( "parentMenu", "operation" );
		model.addAttribute( "childMenu", "partnerConsult" );
		return "partnerConsult/list";
	}

 JSP:

姓名 联系方式 公司名称 公司地址 公司规模 公司描述 建议 操作
${fn:substring(pageList.name,0,10)}..          ${pageList.companyName} ${pageList.companyAddress} ${pageList.companyScale} ${fn:substring(pageList.companyIntro,0,10)}.. ${fn:substring(pageList.suggest,0,10)}..

抱歉,没有找到符合条件的内容!

  • 建议您:
  • 1.适当减少筛选条件,获得更多结果
  • 2.尝试其他关键字
  • 3.立即创建相应内容

 XML

 

你可能感兴趣的:(java技术)