jsp visit spring

来源:互联网 发布:星际老男孩淘宝店地址 编辑:程序博客网 时间:2024/05/16 10:25

<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import=
"org.springframework.context.ApplicationContext"%>
<%@page import=
"org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import=
"ccp.suddenattack.service.news.*"%>
<%@page import=
"com.netstar8.util.page.*"%>
<%@page import=
"net.sf.json.*"%>
<%
ApplicationContext context=WebApplicationContextUtils.getWebApplicationContext(application);
NewsService newsService = (NewsService)context.getBean(
"newsService");
PaginationSupport ps = newsService.findAllNews(10,0);
//out.println(ps.getTotalCount());

JSONObject jsonObject = JSONObject.fromObject(ps);
String jsonStr =
"json503="+jsonObject.toString();
out.println(jsonStr);

%>
原创粉丝点击