Advertisement
KuoHsiangYu

/SpringMVC1/src/main/webapp/WEB-INF/views/insert.jsp

Jul 3rd, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 5.16 KB | None | 0 0
  1. <!--檔案位置:/SpringMVC1/src/main/webapp/WEB-INF/views/insert.jsp-->
  2. <!--這是我的Form表單-->
  3. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  4. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  5. <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
  6. <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10.  
  11. <meta charset="UTF-8">
  12. <link rel="stylesheet"
  13.     href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
  14.  
  15. <style type="text/css">
  16. fieldset {
  17.     border: 1px solid rgb(255, 232, 57);
  18.     width: 400px;
  19.     margin: auto;
  20. }
  21. </style>
  22.  
  23. <title>insert</title>
  24. <%-- <link rel="stylesheet" href="${pageContext.request.contextPath}/css/styles.css" type="text/css" /> --%>
  25. <link rel="stylesheet" href="css/styles.css" type="text/css" />
  26. </head>
  27. <!--<font>&nbsp;&nbsp;格式為yyyy-MM-dd</font>-->
  28. <body bgcolor="#deffac">
  29.     <!-- 1  Integer pk_recipe_id;/*食譜編號*/ -->
  30.     <!-- 2  String recipe_name;/*食譜名稱*/ -->
  31.     <!-- 3  String recipe_quantity;/*食譜份量*/ -->
  32.     <!-- 4  Blob recipe_image;/*食譜圖片*/ -->
  33.     <!-- 5  String recipe_summary;/*食譜簡介*/ -->
  34.     <!-- 6  String recipe_time;/*烹調時間*/ -->
  35.     <!-- 7  String recipe_note;/*小撇步介紹*/ -->
  36.     <!-- 8  java.sql.Date recipe_date;/*食譜時間日期*/ -->
  37.     <!-- 9  Integer recipe_display;/*設定食譜是否顯示【1正常顯示,公開給大家看。】【2草稿階段尚未發布,只限本人觀看。】【3對所有人隱藏起來】*/ -->
  38.     <!-- 10 MultipartFile image_file;/*儲存使用者上傳圖片檔案的欄位*/ -->
  39.     <!-- 11 String fileName;/* 儲存使用者圖片檔案名稱 */ -->
  40.     <div align="center">
  41.         <c:set value="#c4e1ff" var="color" />
  42.         <h1>insert</h1>
  43.         <h2>新增資料</h2>
  44.         <section>
  45.             <div class="container">
  46.                 <h1 style="text-align: center">新增一份食譜</h1>
  47.             </div>
  48.         </section>
  49.         <hr style="height: 1px; border: none; color: #333; background-color: #333;">
  50.         <section class="container">
  51.             <!--三個地方要完全一樣-->
  52.             <form:form method="POST" modelAttribute="RecipeBean"
  53.                 class="form-horizontal" enctype="multipart/form-data" action="insert" >
  54.                 <fieldset>
  55.                
  56.                     <div class="form-group">
  57.                         <!--2.食譜名稱-->
  58.                         <label class="control-label col-lg-2 col-lg-2" for="recipe_name">
  59.                             食譜名稱
  60.                         </label>
  61.                         <div class="col-lg-10">
  62.                             <form:input id="recipe_name" path="recipe_name" name="recipe_name" type="text" class="form:input-large" />
  63.                         </div>
  64.                     </div>
  65.  
  66.                     <div class="form-group">
  67.                         <!--3.食譜份量-->
  68.                         <label class="control-label col-lg-2 col-lg-2" for="recipe_quantity">
  69.                             食譜份量
  70.                         </label>
  71.                         <div class="col-lg-10">
  72.                             <form:input id="recipe_quantity" path="recipe_quantity" name="recipe_quantity" type="text" class="form:input-large" />
  73.                         </div>
  74.                     </div>
  75.  
  76.                     <div class="form-group">
  77.                         <!--10.儲存使用者上傳圖片檔案的欄位-->
  78.                         <label class="control-label col-lg-2 col-lg-2" for="image_file">
  79.                             食譜圖片
  80.                         </label>
  81.                         <div class="col-lg-10">
  82.                             <div class="col-lg-10">
  83.                                 <form:input id="image_file" path="image_file" name="image_file" type="file" class="form:input-large" />
  84.                             </div>
  85.                         </div>
  86.                     </div>
  87.  
  88.                     <div class="form-group">
  89.                         <!--5.食譜簡介-->
  90.                         <label class="control-label col-lg-2 col-lg-2" for="recipe_summary">
  91.                             食譜簡介
  92.                         </label>
  93.                         <div class="col-lg-10">
  94.                             <form:input id="recipe_summary" path="recipe_summary" name="recipe_summary" type="text" class="form:input-large" />
  95.                         </div>
  96.                     </div>
  97.  
  98.                     <div class="form-group">
  99.                         <!--6.烹調時間-->
  100.                         <label class="control-label col-lg-2 col-lg-2" for="recipe_time">
  101.                             烹調時間
  102.                         </label>
  103.                         <div class="col-lg-10">
  104.                             <form:input id="recipe_time" path="recipe_time" name="recipe_time" type="text" class="form:input-large" />
  105.                         </div>
  106.                     </div>
  107.  
  108.                     <div class="form-group">
  109.                         <!--7.小撇步介紹-->
  110.                         <label class="control-label col-lg-2 col-lg-2" for="recipe_note">
  111.                             小撇步介紹
  112.                         </label>
  113.                         <div class="col-lg-10">
  114.                             <form:input id="recipe_note" path="recipe_note" name="recipe_note" type="text" class="form:input-large" />
  115.                         </div>
  116.                     </div>
  117.  
  118.                     <div class="form-group">
  119.                         <!--8.食譜時間日期-->
  120.                         <label class="control-label col-lg-2 col-lg-2" for="recipe_date">
  121.                             食譜時間日期
  122.                         </label>
  123.                         <div class="col-lg-10">
  124.                             <form:input id="recipe_date" path="recipe_date" name="recipe_date" type="text" class="form:input-large" />
  125.                         </div>
  126.                     </div>
  127.  
  128.                     <div class="form-group">
  129.                         <!-- 這是「送出」按鈕 -->
  130.                         <div class="col-lg-offset-2 col-lg-10">
  131.                             <input id="btnAdd" type="submit" class="btn btn-primary" value="確認新增資料" />
  132.                         </div>
  133.                     </div>
  134.  
  135.                 </fieldset>
  136.             </form:form>
  137.         </section>
  138.         <br>
  139.         <a href="home">回首頁</a>
  140.     </div>
  141.     <script>
  142.         console.log("student #1 " + pageContext.request.contextPath);
  143.     </script>
  144. </body>
  145. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement