<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    方槍槍的java世界

    不要因為風雨飄落就停止了你的腳步,真正的得失就在你的心中。 做喜歡做的事,不輕言放棄!

    13 整合spring3和mybatis進行web開發之Hello1Action(RequestMapping豬腳+參數)

    Hello3Action.java

    package com.tianhe.app.pub.hello3.action;

    import javax.servlet.http.HttpServletRequest;

    import org.springframework.stereotype.Controller;
    import org.springframework.ui.ModelMap;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;

    @Controller
    // 請注意類上定義RequestMapping,視圖不以/開始
    @RequestMapping("/pub/hello3")
    public class Hello3Action
    {
        //請求/pub/hello3/helloA/zhangsan/55.do
        //視圖pub/hello3/helloA.jsp
        @RequestMapping("/helloA/{name}/{age}")
        public String helloA(@PathVariable("name") String name, @PathVariable("age") int age)
        {
            System.out.println("hello3.helloA");
            return "pub/hello3/helloA";
        }
       
        // 請求/pub/hello3.do?service=serviceB&username=lisi&password=123456
        // 視圖pub/hello3/helloB.jsp
        @RequestMapping(params = "service=serviceB")
        public String helloB(@RequestParam("username") String username, @RequestParam("password") String password,
                HttpServletRequest request, ModelMap map)
        {
            System.out.println("hello3.helloB");
            return "pub/hello3/helloB";
        }
       
        // 請求/pub/hello3/helloC.do?id=100
        // 視圖/pub/hello3/helloC.jsp
        @RequestMapping("helloC")
        public void helloC(@RequestParam("id") int id)
        {
            System.out.println("hello3.helloC");
        }   
    }


    WEB-INF/pub/hello3/helloA.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
    <head>
    <title>天河框架案例演示</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="
    http://localhost:8080/jxc/skins/default/css/ngmain.css" />
    <script language=javascript src="http://localhost:8080/jxc/skins/default/js/ngcommon.js"></script>
    <script language="javascript">
    function doLogin()
    {
     document.form0.action = "<%=request.getContextPath()%>/loginAction!login.action";
     document.form0.method = "post";
     document.form0.submit();
    }
    </script>
    </head>

    <body>
    <h2>hello3.helloA</h2>

    <center>
    <div id="footer">
    <h5>幫助 | 關于我們 | 使用條款 | 開放平臺</h5>
    <a href="http://localhost:8080/jxc/welcome.jsp">f_qiangqiang@qq.com</a>
    </div>
    </center>
    </body>
    </html>



    WEB-INF/pub/hello3/helloB.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
    <head>
    <title>天河框架案例演示</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="
    http://localhost:8080/jxc/skins/default/css/ngmain.css" />
    <script language=javascript src="http://localhost:8080/jxc/skins/default/js/ngcommon.js"></script>
    <script language="javascript">
    function doLogin()
    {
     document.form0.action = "<%=request.getContextPath()%>/loginAction!login.action";
     document.form0.method = "post";
     document.form0.submit();
    }
    </script>
    </head>

    <body>
    <h2>hello3.helloB</h2>

    <center>
    <div id="footer">
    <h5>幫助 | 關于我們 | 使用條款 | 開放平臺</h5>
    <a href="http://localhost:8080/jxc/welcome.jsp">f_qiangqiang@qq.com</a>
    </div>
    </center>
    </body>
    </html>



    WEB-INF/pub/hello3/helloC.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
    <head>
    <title>天河框架案例演示</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link type="text/css" rel="stylesheet" href="
    http://localhost:8080/jxc/skins/default/css/ngmain.css" />
    <script language=javascript src="http://localhost:8080/jxc/skins/default/js/ngcommon.js"></script>
    <script language="javascript">
    function doLogin()
    {
     document.form0.action = "<%=request.getContextPath()%>/loginAction!login.action";
     document.form0.method = "post";
     document.form0.submit();
    }
    </script>
    </head>

    <body>
    <h2>hello3.helloC</h2>

    <center>
    <div id="footer">
    <h5>幫助 | 關于我們 | 使用條款 | 開放平臺</h5>
    <a href="http://localhost:8080/jxc/welcome.jsp">f_qiangqiang@qq.com</a>
    </div>
    </center>
    </body>
    </html>


    posted on 2012-07-07 15:29 做強大的自己 閱讀(151) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 亚洲综合AV在线在线播放| 久久综合亚洲色一区二区三区| 日日躁狠狠躁狠狠爱免费视频| 亚洲愉拍99热成人精品热久久| 久久精品无码专区免费东京热| 一本色道久久88—综合亚洲精品 | 亚洲综合精品一二三区在线 | 国产高清视频在线免费观看| 久久九九免费高清视频| 亚洲欧洲视频在线观看| 亚洲成A人片在线观看中文| 精品无码国产污污污免费网站 | 国产卡二卡三卡四卡免费网址 | 亚洲AV无码一区二区三区电影| 亚洲尤码不卡AV麻豆| 午夜高清免费在线观看| 久久午夜夜伦鲁鲁片免费无码| 亚洲AV无码AV日韩AV网站| 色婷婷亚洲十月十月色天| 少妇亚洲免费精品| 精品久久久久久久久免费影院| www一区二区www免费| 亚洲日韩精品无码AV海量| 亚洲另类激情综合偷自拍| 亚洲精品国产高清嫩草影院| 午夜宅男在线永久免费观看网| 免费毛片a线观看| 搜日本一区二区三区免费高清视频| 亚洲欧洲国产精品久久| 亚洲精品无码不卡在线播HE| 国产极品美女高潮抽搐免费网站| 麻豆高清免费国产一区| 中文字幕在线免费看| 阿v免费在线观看| 亚洲卡一卡二卡乱码新区| 久久精品亚洲精品国产色婷 | 国产h视频在线观看免费| 暖暖免费在线中文日本| caoporm碰最新免费公开视频| 亚洲久热无码av中文字幕| 亚洲最大在线观看|