public class FirstController implements Controller {
public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
ModelAndView mv=new ModelAndView();
mv.setViewName("index");
return mv;
}
}

  

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
">
<!--视图解析器--> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/"></property>
<property name="suffix" value=".jsp"></property>
</bean>

  

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app>
<display-name>Archetype Created Web Application</display-name>
<!--配置前端控制器-->
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!--初始化参数-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc.xml</param-value>
</init-param> <load-on-startup>1</load-on-startup>
</servlet> <servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping> </web-app>

  

StringMVC的更多相关文章

  1. StringMVC入门案例

    1.首先要引入jar包 <!--引入beans节点--> <dependency> <groupId>org.springframework</groupId ...

  2. StringMVC 中如何做数据校验

    步骤一:引入四个jar包 步骤二:注册类型转换器 <context:component-scan base-package="cn.happy.controller"> ...

  3. StringMVC(拦截器)

    单个拦截器 使用jar包 创建FirstController.java @Controller public class FirstController { @RequestMapping(" ...

  4. StringMVC POJO

    SpringMVC会按请求参数名和POJO类属性名进行自动匹配,自动为该属性填充属性值, 支持级联属性(本类包含其他类对象,如User类有一个属性为Address) 示例代码: index.jsp: ...

  5. StringMVC @RequestParam属性

    1.jsp: <a href="springmvc/testRequestParam?username=allen&age=sss">test RequsetP ...

  6. StringMVC @RequestMapping method属性

    @RequestMapping(value="/testMethod",method=RequestMethod.POST) public String testMethod(){ ...

  7. 文件上传(StringMVC)

    我们经常会使用的一个功能是文件下载,既然有文件下载就会有文件上传,下面我们来看一下文件上传是如何实现的 首先准备好一个页面 jsp <style type="text/css" ...

  8. StringMVC返回字符串

    @RequestMapping(value="twoB.do") public void twoBCode(HttpServletRequest request,HttpServl ...

  9. SpringMvc入门二----HelloWorld

    1. 导入需要的架包: 2. 配置web.xml,添加Servlet <servlet> <servlet-name>springmvc</servlet-name> ...

随机推荐

  1. python之系统编程 --线程

    ###########使用线程完成多任务################ from threading import Thread import time #1. 如果多个线程执行的都是同一个函数的话 ...

  2. mysql客户首末单时间 group by用法_20160927

    一.取用户第一次下单时间 SELECT city,username,`order_date` AS 首单日期,金额 AS 首单金额 FROM ( SELECT city,username,`order ...

  3. poj3666序列对应——DP

    题目:http://poj.org/problem?id=3666 很普通的DP,离散化(sort)一下即可: mn的求法很不错(比我原来开了mn[]……简洁). 代码如下: #include< ...

  4. Zigbee协议栈--Z-Stack的使用

    使用方法简介:一般情况下用户只需要额外添加三个文件就可以完成一个项目.一个是主文件,存放具体的任务事件处理函数:一个是这个主文件的头文件:另外一个是以Osal开头的操作系统接口文件,是专门存放任务处理 ...

  5. wamp + wordpress 安装

    WAMP是一个windows上的php开发集成环境,一键安装php,apache和mysql,非常方便. 双击wampserver2.2exxxxxxxxxx.exe文件进行安装,安装过程中直接下一步 ...

  6. bzoj4176

    莫比乌斯反演 根据约数和个数公式 $ans = \sum_{i=1}^{n}\sum_{j=1}^{n}\sum_{x|i}\sum_{y|j}{[gcd(i, j)==1]}$ 交换枚举顺序 $an ...

  7. JS加DOM理解

    1. ***变量 2. ***数据类型 一. ***变量:内存中存储*一个*数据的存储空间,再起一个名字 何时使用:程序中反复使用的数据,都要先保存在变量中,再参与运算 如何使用:声明   赋值    ...

  8. 如何增加新的PointT类型

    博客转载自:http://www.pclcn.org/study/shownews.php?lang=cn&id=286 为了增加新的point类型,首先需要进行定义,例如: struct M ...

  9. Thinkpad 拆光驱更换光驱硬盘支架、拆光驱面板 T400 T440

    拆光驱.硬盘装支架的环节就不多说了.主要说下拆光驱面板. 先拿细物(区别针.回形针),捅这个洞,就能把光驱仓打开弹出来后,反过来,这里有个卡扣放大看,按住这卡扣,然后往外掰,把面板掰出来 掰出来的面板 ...

  10. eos表结构总结说明

    EOS6.0 WORKFLOW 表结构说明 流程定义表(WFProcessDefine) 名称 代码 描述 流程定义ID processDefID 主键 流程定义名称 processDefName 业 ...