方槍槍的java世界

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

          11 整合spring3和mybatis進行web開發之Hello1Action(類沒有RequestMapping豬腳)

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

          WEB-INF/pub/hello1/hello1A.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>hello1.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/hello1/hello1B.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>hello1.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>

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

          主站蜘蛛池模板: 和田市| 长乐市| 恩施市| 称多县| 灌云县| 塔城市| 永善县| 壶关县| 静宁县| 科尔| 郴州市| 威宁| 铜陵市| 深泽县| 岳西县| 黄石市| 兴业县| 昌都县| 白银市| 抚顺市| 塘沽区| 河北区| 吐鲁番市| 邯郸县| 涞水县| 合阳县| 张家界市| 永德县| 万安县| 兴隆县| 鄯善县| 杨浦区| 临城县| 蒙阴县| 广西| 文成县| 独山县| 西青区| 高唐县| 武定县| 饶阳县|