• 大小: 1.38MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-12
  • 语言: 其他
  • 标签: ssmCOO、  

资源简介

maven项目搭建,json数据格式,ajax读取,

资源截图

代码片段和文件信息

package com.cooint.ssmcoo.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
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.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.cooint.ssmcoo.pojo.ArticeList;

@Controller
@RequestMapping(“/ArticeListController“)
public class ArticeListController {
@Autowired
private com.cooint.ssmcoo.Service.ArticeListService ArticeListService;
/**
 * 查询的是文章列表的信息
 * @param model
 * @return 返回的是json的数据格式
 */
@RequestMapping(value=“/show“ method = { RequestMethod.POST RequestMethod.GET } produces = “text/json;charset=UTF-8“)
@ResponseBody
public String getA(Model model)
{
List listar=ArticeListService.selectArticeList();
String list = JSON.toJSONString(listar);
System.out.println(“=“+list.toString());
model.addAttribute(“list“ list);
return list;

}
/**
 * 根据ID查询出文章列表的信息
 * @return sf --返回json格式的数据
 */
@RequestMapping(value=“/getIdArtice“)
public ArticeList getIDselectArtice()
{
ArticeList sf=ArticeListService.selectID(1);
String list = JSON.toJSONString(sf);
System.out.println(“根据ID查询:“+list.toString());
return sf;

}


}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-08-03 21:44  ssmcoo\
     文件        1770  2017-08-03 14:42  ssmcoo\.classpath
     文件        1082  2017-08-02 22:43  ssmcoo\.project
     目录           0  2017-08-03 21:36  ssmcoo\.settings\
     文件         639  2017-08-02 22:43  ssmcoo\.settings\.jsdtscope
     文件         229  2017-08-02 22:43  ssmcoo\.settings\org.eclipse.core.resources.prefs
     文件          52  2017-08-02 22:43  ssmcoo\.settings\org.eclipse.core.runtime.prefs
     文件         736  2017-08-02 22:43  ssmcoo\.settings\org.eclipse.jdt.core.prefs
     文件          90  2017-08-02 22:43  ssmcoo\.settings\org.eclipse.m2e.core.prefs
     文件         753  2017-08-03 14:54  ssmcoo\.settings\org.eclipse.wst.common.component
     文件         252  2017-08-02 22:45  ssmcoo\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-08-02 22:43  ssmcoo\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-08-02 22:43  ssmcoo\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件          50  2017-08-02 22:43  ssmcoo\.settings\org.eclipse.wst.validation.prefs
     文件       11864  2017-08-02 22:43  ssmcoo\pom.xml
     目录           0  2017-08-03 21:36  ssmcoo\src\
     目录           0  2017-08-03 21:36  ssmcoo\src\main\
     目录           0  2017-08-03 11:38  ssmcoo\src\main\config\
     目录           0  2017-08-03 21:36  ssmcoo\src\main\java\
     目录           0  2017-08-03 21:36  ssmcoo\src\main\java\com\
     目录           0  2017-08-03 21:36  ssmcoo\src\main\java\com\cooint\
     目录           0  2017-08-03 21:36  ssmcoo\src\main\java\com\cooint\ssmcoo\
     目录           0  2017-08-03 23:39  ssmcoo\src\main\java\com\cooint\ssmcoo\controller\
     文件        1728  2017-08-03 18:33  ssmcoo\src\main\java\com\cooint\ssmcoo\controller\ArticeListController.java
     文件          84  2017-08-03 23:39  ssmcoo\src\main\java\com\cooint\ssmcoo\controller\ArtsOrLableController.java
     文件        1192  2017-08-04 07:35  ssmcoo\src\main\java\com\cooint\ssmcoo\controller\CommentController.java
     文件        1458  2017-08-04 07:16  ssmcoo\src\main\java\com\cooint\ssmcoo\controller\LableController.java
     文件         591  2017-08-03 22:08  ssmcoo\src\main\java\com\cooint\ssmcoo\controller\LcsyController.java
     文件        4195  2017-08-03 12:16  ssmcoo\src\main\java\com\cooint\ssmcoo\controller\StorageController.java
     目录           0  2017-08-03 23:37  ssmcoo\src\main\java\com\cooint\ssmcoo\dao\
     文件         809  2017-08-03 13:29  ssmcoo\src\main\java\com\cooint\ssmcoo\dao\ArticeListDao.java
............此处省略126个文件信息

评论

共有 条评论

相关资源