<?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. 微软职位内部推荐-Principal Development Lead

    微软近期Open的职位: Job Title: Principal Development Lead Work Location: Suzhou, China This is a once in a ...

  2. [转]reids客户端 redis-cli用法

    连接:redis-cli -h machine -p port -n db转的:每次都搜,还是扔在这 Redis提供了丰富的命令(command)对数据库和各种数据类型进行操作,这些command可以 ...

  3. C语言 三级指针的应用

    //三级指针的使用 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #includ ...

  4. C语言 简单的队列(数组队列)

    //简单的队列 #include<stdio.h> #include<stdlib.h> #define datatype int #define N 10 //定义队列结构体 ...

  5. C#属性有什么作用

    1,主要作用:将读,写权限分开.如果不使用属性,仅使用public, protected, private,这几个限制都是读,写属性一起的,可读就可写,不可读同时也不可写.不能实现只读不可写,只写不可 ...

  6. IBatisNet基础组件

    DomSqlMapBuilder DomSqlMapBuilder,其作用是根据配置文件创建SqlMap实例.可以通过这个组件从Stream, Uri, FileInfo, or XmlDocumen ...

  7. C#模拟POST提交表单(一)--WebClient

    C#的提交表单方式主要有两种WebClient与HttpWebRequest,这里先介绍一种 WebClient,转送门:http://msdn.microsoft.com/zh-cn/library ...

  8. JS 之DOM对象(2)

    http://www.cnblogs.com/zourong/p/4792394.html 这篇文件介绍了DOM1中的一些属性和方法,下面的内容主要介绍DOM2和DOM3中新增的内容. 框架的变化 框 ...

  9. dxut.h(29): fatal error C1083: Cannot open include file: 'dxsdkver.h': No such file or directory

    从网上download一个三维演示模型的软件编译发现报找不到dxsdkver.h文件,网上查阅这是MS的DirectX sdk中的库文件,于是先download DirectX SDK 安装之后,配置 ...

  10. 1.1Linux 系统简介(学习过程)

    =====课程笔记===== 一.Linux 为何物 Linux 是一个操作系统,就像你多少已经了解的 Windows(xp,7,8)和 Max OS . Linux 也就是系统调用和内核两层,我们使 ...