Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--檔案位置:/SpringMVC1/src/main/webapp/WEB-INF/views/insert.jsp-->
- <!--這是我的Form表單-->
- <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
- <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <link rel="stylesheet"
- href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
- <style type="text/css">
- fieldset {
- border: 1px solid rgb(255, 232, 57);
- width: 400px;
- margin: auto;
- }
- </style>
- <title>insert</title>
- <%-- <link rel="stylesheet" href="${pageContext.request.contextPath}/css/styles.css" type="text/css" /> --%>
- <link rel="stylesheet" href="css/styles.css" type="text/css" />
- </head>
- <!--<font> 格式為yyyy-MM-dd</font>-->
- <body bgcolor="#deffac">
- <!-- 1 Integer pk_recipe_id;/*食譜編號*/ -->
- <!-- 2 String recipe_name;/*食譜名稱*/ -->
- <!-- 3 String recipe_quantity;/*食譜份量*/ -->
- <!-- 4 Blob recipe_image;/*食譜圖片*/ -->
- <!-- 5 String recipe_summary;/*食譜簡介*/ -->
- <!-- 6 String recipe_time;/*烹調時間*/ -->
- <!-- 7 String recipe_note;/*小撇步介紹*/ -->
- <!-- 8 java.sql.Date recipe_date;/*食譜時間日期*/ -->
- <!-- 9 Integer recipe_display;/*設定食譜是否顯示【1正常顯示,公開給大家看。】【2草稿階段尚未發布,只限本人觀看。】【3對所有人隱藏起來】*/ -->
- <!-- 10 MultipartFile image_file;/*儲存使用者上傳圖片檔案的欄位*/ -->
- <!-- 11 String fileName;/* 儲存使用者圖片檔案名稱 */ -->
- <div align="center">
- <c:set value="#c4e1ff" var="color" />
- <h1>insert</h1>
- <h2>新增資料</h2>
- <section>
- <div class="container">
- <h1 style="text-align: center">新增一份食譜</h1>
- </div>
- </section>
- <hr style="height: 1px; border: none; color: #333; background-color: #333;">
- <section class="container">
- <!--三個地方要完全一樣-->
- <form:form method="POST" modelAttribute="RecipeBean"
- class="form-horizontal" enctype="multipart/form-data" action="insert" >
- <fieldset>
- <div class="form-group">
- <!--2.食譜名稱-->
- <label class="control-label col-lg-2 col-lg-2" for="recipe_name">
- 食譜名稱
- </label>
- <div class="col-lg-10">
- <form:input id="recipe_name" path="recipe_name" name="recipe_name" type="text" class="form:input-large" />
- </div>
- </div>
- <div class="form-group">
- <!--3.食譜份量-->
- <label class="control-label col-lg-2 col-lg-2" for="recipe_quantity">
- 食譜份量
- </label>
- <div class="col-lg-10">
- <form:input id="recipe_quantity" path="recipe_quantity" name="recipe_quantity" type="text" class="form:input-large" />
- </div>
- </div>
- <div class="form-group">
- <!--10.儲存使用者上傳圖片檔案的欄位-->
- <label class="control-label col-lg-2 col-lg-2" for="image_file">
- 食譜圖片
- </label>
- <div class="col-lg-10">
- <div class="col-lg-10">
- <form:input id="image_file" path="image_file" name="image_file" type="file" class="form:input-large" />
- </div>
- </div>
- </div>
- <div class="form-group">
- <!--5.食譜簡介-->
- <label class="control-label col-lg-2 col-lg-2" for="recipe_summary">
- 食譜簡介
- </label>
- <div class="col-lg-10">
- <form:input id="recipe_summary" path="recipe_summary" name="recipe_summary" type="text" class="form:input-large" />
- </div>
- </div>
- <div class="form-group">
- <!--6.烹調時間-->
- <label class="control-label col-lg-2 col-lg-2" for="recipe_time">
- 烹調時間
- </label>
- <div class="col-lg-10">
- <form:input id="recipe_time" path="recipe_time" name="recipe_time" type="text" class="form:input-large" />
- </div>
- </div>
- <div class="form-group">
- <!--7.小撇步介紹-->
- <label class="control-label col-lg-2 col-lg-2" for="recipe_note">
- 小撇步介紹
- </label>
- <div class="col-lg-10">
- <form:input id="recipe_note" path="recipe_note" name="recipe_note" type="text" class="form:input-large" />
- </div>
- </div>
- <div class="form-group">
- <!--8.食譜時間日期-->
- <label class="control-label col-lg-2 col-lg-2" for="recipe_date">
- 食譜時間日期
- </label>
- <div class="col-lg-10">
- <form:input id="recipe_date" path="recipe_date" name="recipe_date" type="text" class="form:input-large" />
- </div>
- </div>
- <div class="form-group">
- <!-- 這是「送出」按鈕 -->
- <div class="col-lg-offset-2 col-lg-10">
- <input id="btnAdd" type="submit" class="btn btn-primary" value="確認新增資料" />
- </div>
- </div>
- </fieldset>
- </form:form>
- </section>
- <br>
- <a href="home">回首頁</a>
- </div>
- <script>
- console.log("student #1 " + pageContext.request.contextPath);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement