微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用Dojo创建标签页

1、在上次搭建的环境下,新建一个“tabs_form.jsp”页面

2、在页面中编写如下代码

 
 
  1. <%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>
  2. <%
  3. Stringpath=request.getcontextpath();
  4. StringbasePath=request.getScheme()+"://"
  5. +request.getServerName()+":"+request.getServerPort()
  6. +path+"/";
  7. %>
  8. <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
  9. <html>
  10. <head>
  11. <basehref="<%=basePath%>">
  12. <title>Dojo--tabs_form</title>
  13. <Metahttp-equiv="pragma"content="no-cache">
  14. <Metahttp-equiv="cache-control"content="no-cache">
  15. <Metahttp-equiv="expires"content="0">
  16. <Metahttp-equiv="keywords"content="keyword1,keyword2,keyword3">
  17. <Metahttp-equiv="description"content="Thisismypage">
  18. <linkrel="stylesheet"type="text/css"
  19. href="scripts/dojo-release-1.8.1/dijit/themes/tundra/tundra.css">
  20. <linkrel="stylesheet"type="text/css"
  21. href="scripts/dojo-release-1.8.1/dojo/resources/dojo.css">
  22. <!--引入dojo.js-->
  23. <scripttype="text/javascript"
  24. src="scripts/dojo-release-1.8.1/dojo/dojo.js"
  25. djCon@R_404_6408@="parSEOnLoad:true,isDebug:true"></script>
  26. <scripttype="text/javascript">
  27. dojo.require("dojo.parser");
  28. dojo.require("dijit.layout.ContentPane");
  29. dojo.require("dijit.layout.TabContainer");
  30. </script>
  31. </head>
  32. <bodyclass="tundra">
  33. <divdojoType="dijit.layout.TabContainer"style="width:600px;height:300px;">
  34. <divdojoType="dijit.layout.ContentPane"title="个人信息">
  35. <labelfor="name">
  36. 姓  名:
  37. </label>
  38. <inputtype="text"name="name"id="name"size="30"/>
  39. <br>
  40. <labelfor="age">
  41. 年  龄:
  42. </label>
  43. <inputtype="text"name="age"id="age"size="30"/>
  44. <br>
  45. <labelfor="sex">
  46. 性  别:
  47. </label>
  48. <inputtype="text"name="sex"id="sex"size="30"/>
  49. <br>
  50. <labelfor="email">
  51. 电子邮件:
  52. </label>
  53. <inputtype="text"name="email"id="email"size="30"/>
  54. <br>
  55. </div>
  56. <divdojoType="dijit.layout.ContentPane"title="地址信息">
  57. <labelfor="country">
  58. 国  家:
  59. </label>
  60. <inputtype="text"name="country"id="country"size="30"/>
  61. <br>
  62. <labelfor="province">
  63. 所属省份:
  64. </label>
  65. <inputtype="text"name="province"id="province"size="30"/>
  66. <br>
  67. <labelfor="city">
  68. 所属城市:
  69. </label>
  70. <inputtype="text"name="city"id="city"size="30"/>
  71. <br>
  72. </div>
  73. </div>
  74. </body>
  75. </html>

3、启动tomcat服务器,打开“http://localhost:8080/dojo_test/tabs_form.jsp”即可访问到如下所示的页面

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐