<?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. javascript中的迭代器

    1.forEach迭代器 forEach方法接收一个函数作为参数,对数组中每个元素使用这个函数,只调用这个函数,数组本身没有任何变化 //forEach迭代器 function square(num) ...

  2. Struts登录

  3. PowerDesigner16建表在SQL SERVER 2008报 对象名 'sysproperties' 无效。

    http://blog.itpub.net/30150152/viewspace-1454979/

  4. C#实现对指定文件夹中文件按修改时间排序

    string path = "~/Document/Introduction/团队管理制度/";            DirectoryInfo dirinfo = new Di ...

  5. Web API 实现JSONP或者安装配置Cors跨域

    前言 照理来说本节也应该讲Web API原理,目前已经探讨完了比较底层的Web API消息处理管道以及Web Host寄宿管道,接下来应该要触及控制器.Action方法,以及过滤器.模型绑定等等,想想 ...

  6. [CareerCup] 5.4 Explain Expression ((n & (n-1)) == 0) 解释表达式

    5.4 Explain what the following code does: ((n & (n-1)) == 0). 这道题让我们解释一个表达式((n & (n-1)) == 0 ...

  7. IOS开发之—— ShareSDK的使用

    官方下载ShareSDK iOS:http://sharesdk.cn/ ShareSDK社会化分享 包含“社会化分享组件”“社会化登录组件”“第三方评论和赞”三大模块,并有详尽的数据统计后台,助力移 ...

  8. <实训|第四天>Linux下的vim你真的掌握了吗?附上ftp远程命令上传。

    期待已久的linux运维.oracle"培训班"终于开班了,我从已经开始长期四个半月的linux运维.oracle培训,每天白天我会好好学习,晚上回来我会努力更新教程,包括今天学到 ...

  9. .net,微软,薪资及其他

    很久没在博客园上写些东西,因为我的确没有什么技术上面新奇的心得和大家分享,园子里面的文章页没啥看的,基本就是看一下业界新闻,因为这里面99%的东西没什么看头,更像是个人技术笔记汇总. 我从07年从de ...

  10. 在运行程序时报错:"如果在 Code First 模式下使用,则使用 T4 模板为 Database First 和 Model First 开发生成的代码可能无法 正常运行。若要继续使用 Database First 或 Model First,请确保在执行应用程序的 config 文件中指 定 Entity Framework 连接字符串。若要将这些从 Database First 或 Mod

    解决方案: 将context类下的方法“OnModelCreating”修改为: protected override void OnModelCreating(DbModelBuilder mode ...