• 大小: 48.72MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-17
  • 语言: 其他
  • 标签: springmvc  

资源简介

传智播客2016springmvc资料

资源截图

代码片段和文件信息

package cn.itcast.ssm.controller;

import java.util.ArrayList;
import java.util.List;

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

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import cn.itcast.ssm.po.Items;

/**
 * 
 * 

title: ItemsController1


 * 

Description:实现controller接口的 处理器 


 * 

Company: www.itcast.com

 
 * @author 传智.燕青
 * @date 2015-4-13上午10:46:17
 * @version 1.0
 */
public class ItemsController1 implements Controller {

@Override
public ModelAndView handleRequest(HttpServletRequest request
HttpServletResponse response) throws Exception {

//调用service查找 数据库,查询商品列表,这里使用静态数据模拟
List itemsList = new ArrayList();
//向list中填充静态数据

Items items_1 = new Items();
items_1.setName(“联想笔记本“);
items_1.setPrice(6000f);
items_1.setDetail(“ThinkPad T430 联想笔记本电脑!“);

Items items_2 = new Items();
items_2.setName(“苹果手机“);
items_2.setPrice(5000f);
items_2.setDetail(“iphone6苹果手机!“);

itemsList.add(items_1);
itemsList.add(items_2);

//返回ModelAndView
ModelAndView modelAndView =  new ModelAndView();
//相当 于request的setAttribut,在jsp页面中通过itemsList取数据
modelAndView.addobject(“itemsList“ itemsList);

//指定视图
modelAndView.setViewName(“/WEB-INF/jsp/items/itemsList.jsp“);

return modelAndView;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        896  2016-12-30 16:52  springmvc资料\day01\code\springmvcfirst1208\.classpath

     文件       1051  2016-12-30 16:52  springmvc资料\day01\code\springmvcfirst1208\.project

     文件        500  2016-12-30 16:55  springmvc资料\day01\code\springmvcfirst1208\.settings\.jsdtscope

     文件        364  2016-12-30 16:55  springmvc资料\day01\code\springmvcfirst1208\.settings\org.eclipse.jdt.core.prefs

     文件        590  2016-12-30 16:55  springmvc资料\day01\code\springmvcfirst1208\.settings\org.eclipse.wst.common.component

     文件        345  2016-12-30 16:55  springmvc资料\day01\code\springmvcfirst1208\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2016-12-30 16:55  springmvc资料\day01\code\springmvcfirst1208\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2016-12-30 16:55  springmvc资料\day01\code\springmvcfirst1208\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       3656  2016-12-30 16:55  springmvc资料\day01\code\springmvcfirst1208\config\springmvc.xml

     文件       1625  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\src\cn\itcast\ssm\controller\ItemsController1.java

     文件       1862  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\src\cn\itcast\ssm\controller\ItemsController2.java

     文件       3122  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\src\cn\itcast\ssm\controller\ItemsController3.java

     文件       1196  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\src\cn\itcast\ssm\po\Items.java

     文件        795  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\src\cn\itcast\ssm\po\Orderdetail.java

     文件       1023  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\src\cn\itcast\ssm\po\Orders.java

     文件       1051  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\src\cn\itcast\ssm\po\User.java

     文件         39  2016-12-30 16:56  springmvc资料\day01\code\springmvcfirst1208\WebRoot\meta-INF\MANIFEST.MF

     文件       1846  2016-12-30 17:06  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\cn\itcast\ssm\controller\ItemsController1.class

     文件       1889  2016-12-30 17:06  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\cn\itcast\ssm\controller\ItemsController2.class

     文件       1744  2016-12-30 17:06  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\cn\itcast\ssm\controller\ItemsController3.class

     文件       1831  2016-12-30 17:06  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\cn\itcast\ssm\po\Items.class

     文件       1118  2016-12-30 17:06  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\cn\itcast\ssm\po\Orderdetail.class

     文件       1551  2016-12-30 17:06  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\cn\itcast\ssm\po\Orders.class

     文件       1587  2016-12-30 17:06  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\cn\itcast\ssm\po\User.class

     文件       3656  2016-12-30 16:56  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\classes\springmvc.xml

     文件       1235  2016-12-30 17:05  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\jsp\items\itemsList.jsp

     文件      60686  2016-12-30 16:56  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\lib\commons-logging-1.1.1.jar

     文件     414240  2016-12-30 16:56  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\lib\jstl-1.2.jar

     文件     334895  2016-12-30 16:56  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\lib\spring-aop-3.2.0.RELEASE.jar

     文件      69808  2016-12-30 16:56  springmvc资料\day01\code\springmvcfirst1208\WebRoot\WEB-INF\lib\spring-aspects-3.2.0.RELEASE.jar

............此处省略494个文件信息

评论

共有 条评论