<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<context:annotation-config /> <!-- 设置使用注解的类所在的jar包 -->
<context:component-scan base-package="com.haier.framework.tms"></context:component-scan> <!-- 完成请求和注解POJO的映射 -->
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> <!-- 对转向页面的路径解析。prefix:前缀, suffix:后缀 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/pages/" />
</beans>
/**
*
*/
package com.haier.framework.tms; import java.io.IOException;
import java.util.List; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView; import com.google.gson.Gson;
import com.haier.framework.core.utils.CommonJdbcDaoUtils;
import com.haier.framework.core.utils.Page;
import com.haier.framework.tms.module.TMS_LEG; /**
* @author XH
*
*/
@Controller
@RequestMapping(value = "/tms/ui/*")
public class TmsController { /**
*
*
* @return
*/
@RequestMapping(value = "index.jhtml", method = RequestMethod.GET)
public ModelAndView initEchartsLH(HttpServletRequest request, HttpServletResponse response) {
Gson gson = new Gson();
System.out.println("查询==============");
List<TMS_LEG> mm = CommonJdbcDaoUtils.query("select * from TMS_LEG where rownum<20", TMS_LEG.class);
System.out.println("query" + gson.toJson(mm)); System.out.println("get==============");
TMS_LEG leg = CommonJdbcDaoUtils.get("select * from TMS_LEG where rownum<20", TMS_LEG.class);
System.out.println("get==============" + gson.toJson(leg)); String sysdat = CommonJdbcDaoUtils.queryObject("select sysdate from dual", String.class);
System.out.println("QueryObject==============" + sysdat); request.setAttribute("sysdate", sysdat);
int start = 0;
int limit = 10;
Page page = new Page(start, limit, -1, limit, null);
CommonJdbcDaoUtils.findBySql(page, "select * from TMS_LEG where rownum<21",
"select count(1) from TMS_LEG where rownum<21", TMS_LEG.class);
System.out.println("page" + gson.toJson(page));
// return new ModelAndView(new RedirectView("../index.jsp"));
// return new ModelAndView("loginSuccess");
// @RequestParam是指请求url地址映射中必须含有的参数(除非属性required=false)
// @RequestParam可简写为:@RequestParam("username")
// RequestMapping("test/login.do") // 请求url地址映射,类似Struts的action-mapping
// public String testLogin(@RequestParam(value="username")String
// username, String password, HttpServletRequest request)
return new ModelAndView("tms/index.jsp");
} @RequestMapping(value = "getGrid")
public void getGrid(HttpServletRequest request, HttpServletResponse response) throws IOException {
Gson gson = new Gson();
String json = "";
String start = request.getParameter("start");
String limit = request.getParameter("limit");
Page page = new Page(Integer.parseInt(start), Integer.parseInt(limit), -1, Integer.parseInt(limit), null);
CommonJdbcDaoUtils.findBySql(page, "select * from TMS_LEG where rownum<21",
"select count(1) from TMS_LEG where rownum<21", TMS_LEG.class);
json = gson.toJson(page);
System.out.println("page" + json);
response.getWriter().write(json);
}
}

SpringMVC 2.5.6 noMapping的更多相关文章

  1. 【分享】标准springMVC+mybatis项目maven搭建最精简教程

    文章由来:公司有个实习同学需要做毕业设计,不会搭建环境,我就代劳了,顺便分享给刚入门的小伙伴,我是自学的JAVA,所以我懂的.... (大图直接观看显示很模糊,请在图片上点击右键然后在新窗口打开看) ...

  2. Springmvc数据校验

    步骤一:导入四个jar包 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=" ...

  3. 为什么做java的web开发我们会使用struts2,springMVC和spring这样的框架?

    今年我一直在思考web开发里的前后端分离的问题,到了现在也颇有点心得了,随着这个问题的深入,再加以现在公司很多web项目的控制层的技术框架由struts2迁移到springMVC,我突然有了一个新的疑 ...

  4. 【SSM框架】Spring + Springmvc + Mybatis 基本框架搭建集成教程

    本文将讲解SSM框架的基本搭建集成,并有一个简单demo案例 说明:1.本文暂未使用maven集成,jar包需要手动导入. 2.本文为基础教程,大神切勿见笑. 3.如果对您学习有帮助,欢迎各种转载,注 ...

  5. 快速搭建springmvc+spring data jpa工程

    一.前言 这里简单讲述一下如何快速使用springmvc和spring data jpa搭建后台开发工程,并提供了一个简单的demo作为参考. 二.创建maven工程 http://www.cnblo ...

  6. redis集成到Springmvc中及使用实例

    redis是现在主流的缓存工具了,因为使用简单.高效且对服务器要求较小,用于大数据量下的缓存 spring也提供了对redis的支持: org.springframework.data.redis.c ...

  7. 流程开发Activiti 与SpringMVC整合实例

    流程(Activiti) 流程是完成一系列有序动作的概述.每一个节点动作的结果将对后面的具体操作步骤产生影响.信息化系统中流程的功能完全等同于纸上办公的层级审批,尤其在oa系统中各类电子流提现较为明显 ...

  8. springMVC学习笔记--知识点总结1

    以下是学习springmvc框架时的笔记整理: 结果跳转方式 1.设置ModelAndView,根据view的名称,和视图渲染器跳转到指定的页面. 比如jsp的视图渲染器是如下配置的: <!-- ...

  9. springMVC初探--环境搭建和第一个HelloWorld简单项目

    注:此篇为学习springMVC时,做的笔记整理. MVC框架要做哪些事情? a,将url映射到java类,或者java类的方法上 b,封装用户提交的数据 c,处理请求->调用相关的业务处理—& ...

随机推荐

  1. 基于Nodejs生态圈的TypeScript+React开发入门教程

    基于Nodejs生态圈的TypeScript+React开发入门教程   概述 本教程旨在为基于Nodejs npm生态圈的前端程序开发提供入门讲解. Nodejs是什么 Nodejs是一个高性能Ja ...

  2. C# log4net 不输出日志

    一个新项目,直接用了一些之前的代码,突然跟踪不到日志了.检查发现了原因,特在此记录. log4net的配置文件log4net_config.xml <?xml version="1.0 ...

  3. JS案例之5——移动端触屏滑动

    移动端触屏滑动的效果其实就是图片轮播,在PC的页面上很好实现,绑定click和mouseover等事件来完成.但是在移动设备上,要实现这种轮播的效果,就需要用到核心的touch事件.处理touch事件 ...

  4. 用python简单处理图片(3):添加水印

    python版本:3.4 Pillow版本:3.0 一.添加文字水印 from PIL import Image, ImageDraw,ImageFont im = Image.open(" ...

  5. linux(centos 6.4)下安装php memcache服务端及其客户端(详细教程)

    前言 在搭建个人博客时,由于没有使用任何框架,纯手工code前台和后台,导致遇到许多问题,其中一个问题就是mysql连接导致的页面相应速度异常低.在查询各种途径后,只能考虑使用memcache缓存.在 ...

  6. matlab 中的textscan

    textread 与textscan的区别  textscan更适合读入大文件: textscan可以从文件的任何位置开始读入,而textread 只能从文件开头开始读入: textscan也可以从上 ...

  7. C#中 += (s, e) => 这些字符什么意思

    public MainWindow(){InitializeComponent();this.Loaded += (s, e) => DiscoverKinectSensor();this.Un ...

  8. eclipse项目编码问题

    使得eclipse的新建项目的默认编码直接为UTF-8: 在菜单栏的Window->Preferences->General->Workspace->Text file enc ...

  9. brew-cask 之本地更新 node

    本文同步自我的个人博客:http://www.52cik.com/2015/11/04/brew-cask-local.html 今天 Node v4.2.2 (LTS) 发布,什么是 LTS 呢,百 ...

  10. java并发:中断一个正在运行的线程

    要使任务和线程能安全可靠地停止,并不是一件很容易的事情,java没有提供任何机制来安全地终止线程,那么我们该怎么办呢? 下面我们先来了解一下java中的中断机制: java中断机制是一种协作机制,也就 ...