<%@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);
%>
jsp visit spring
最新推荐文章于 2023-12-07 14:32:25 发布
本文详细介绍了如何将Java代码中的JSON数据进行解析并呈现为网页输出的过程,包括使用Spring框架和相关工具进行数据获取和格式化。

6243

被折叠的 条评论
为什么被折叠?



