方槍槍的java世界

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

          12 整合spring3和mybatis進(jìn)行web開發(fā)之Hello1Action(RequestMapping豬腳)

          Hello2Action.java

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

          import org.springframework.stereotype.Controller;
          import org.springframework.web.bind.annotation.RequestMapping;

          @Controller
          //請注意類上定義RequestMapping,視圖不以/開始
          @RequestMapping("/pub/hello2")
          public class Hello2Action
          {
              @RequestMapping("/helloA")
              public String helloMethodA()
              {
                  System.out.println("hello2.helloA");
                  return "pub/hello2/helloA";
              }
             
              @RequestMapping("/helloB")
              public String helloMethodB()
              {
                  System.out.println("hello2.helloB");
                  return "pub/hello2/helloB";
              }
          }


          WEB-INF/pub/hello2/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>hello2.helloA</h2>

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


          WEB-INF/pub/hello2/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>hello2.helloB</h2>

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



          posted on 2012-07-07 15:26 做強(qiáng)大的自己 閱讀(451) 評論(0)  編輯  收藏 所屬分類: Spring

          主站蜘蛛池模板: 马关县| 馆陶县| 利津县| 阜平县| 泰安市| 光泽县| 永登县| 平武县| 客服| 曲阜市| 民和| 南城县| 毕节市| 汽车| 泗阳县| 巴东县| 台南市| 龙井市| 绥中县| 庆元县| 嘉定区| 汪清县| 杨浦区| 峨山| 灵寿县| 平泉县| 噶尔县| 崇阳县| 和龙市| 金秀| 炎陵县| 新竹县| 全南县| 左权县| 叶城县| 嘉善县| 河池市| 城固县| 鄂伦春自治旗| 信丰县| 闽侯县|