---
# System prepended metadata

title: 1/23 JSP 觀念
tags: [JSP]

---

# 1/23 JSP 觀念

###### tags: `JSP`
# 5-146.147 Bean Property值的轉換規則
![](https://i.imgur.com/pYyUg4b.png)![](https://i.imgur.com/XnjLZJs.png)
# 5-148 設定JavaBeans Component Properties
![](https://i.imgur.com/vrQaQyy.png)
Java大小寫有差別
"*"萬用字元
3.一定要是request參數名稱![](https://i.imgur.com/NkxsDsa.png)![](https://i.imgur.com/hWDB6gc.png)
# 5-149 Bean的共用
沒指定預設，會從page開始找
(參考127)![](https://i.imgur.com/apAjYUw.png)
# 5-150 Conditional Bean的產生
(SharedCounts1.jsp 2 .3)
(AccessCountBean.java)![](https://i.imgur.com/WC2BNOx.png)
沒有useBean則需要產生，中間夾的那個敘述才會執行![](https://i.imgur.com/6jsjTjj.png)
大家共用計數器![](https://i.imgur.com/7iCWlMt.png)
(參考138.139)![](https://i.imgur.com/SW9LhJD.png)
# 5-151 JavaBean class的範例
Bean要在Package裡面![](https://i.imgur.com/zsyzzrX.png)
(參考125)
# 5-153.154 大綱
![](https://i.imgur.com/sp0C5PP.png)![](https://i.imgur.com/Xn9WCuQ.png)
# 5-155 Jsp Architecture Models
![](https://i.imgur.com/PgbwOBL.png)
# 5-156.157 Model 1 .2 
![](https://i.imgur.com/YTZUcvX.png)
身分權限Controller->jsp
jsp改漂亮就好
![](https://i.imgur.com/PMIzPMY.png)
(參考servlet4-15)(B=JavaBean,S=Servlet,J=JSP)![](https://i.imgur.com/JLDF1oH.png)
# 5-158 MVA Demo(範例一)
(RegisterServlet.java)
(StudentBean.java)
(Thanks.jsp)
(DisplayStudent.jsp)
(StudentDAO.java)
(RegisterForm.jsp)(xml)
``
<servlet>
    <description></description>
    <display-name>RegisterServlet</display-name>
    <servlet-name>RegisterServlet</servlet-name>
    <servlet-class>RegisterServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>RegisterServlet</servlet-name>
    <url-pattern>/RegisterServlet</url-pattern>
  </servlet-mapping>
  ``
 建構子![](https://i.imgur.com/eCariKu.png)
![](https://i.imgur.com/sljiDoO.png)![](https://i.imgur.com/68t4p1H.png)
# 5-159 建立jwstudent table
(crestudent4sqlsvr.sql)
# 5-160 MVC EBookShop with Servlets,JSPs,and JavaBeans Deployed in Tomcat(範例二)
![](https://i.imgur.com/pMWvNrc.png)
# 5-161  MVC+Shopping Cart(購物車)--Ebookshop
![](https://i.imgur.com/H3Uzzvf.png)
# 5-162 建立books table
(ebookshop4sqlsvr.sql)
# 5-163.164 JSP with Connection Pooling
(queryTest.jsp)
![](https://i.imgur.com/47ZDwHF.png)
# 5-165 Servlet with Connection Pooling
(MySQLTestServlet.jsp)
![](https://i.imgur.com/uTYOvu8.png)
# 5-166 Model:Book Database
(BookDB.java)
沒有建構子 符合沒有參數的建構子
# 5-167 CartItem.java
(CartItem.java)
[bookid]用bookid就能查 
![](https://i.imgur.com/Kx4J1Kc.png)
(參考161)![](https://i.imgur.com/lBnR0kB.png)
# 5-168 Controller
(ControllerServlet.java)![](https://i.imgur.com/ZxLgFgX.png)![](https://i.imgur.com/m3fqmez.png)
list轉換成Bean 陣列型態
從第0比 開始轉成一筆一筆陣列型態 toArray![](https://i.imgur.com/AoDWDCZ.png)![](https://i.imgur.com/RjD81Ve.png)
https://docs.oracle.com/javase/8/docs/api/
# 5-169 View:Order Page
(order.jsp)![](https://i.imgur.com/DorDTsL.png)
``
<input type="submit" value="Checkout">
`` 全部秀出來
(參考161)
# 5-170 View:Checkout Page
(checkout.jsp)![](https://i.imgur.com/NMzfebl.png)
![](https://i.imgur.com/IxDFK9x.png)
Java.lang string[]
https://docs.oracle.com/javase/8/docs/api/
api formatter
![](https://i.imgur.com/JkcWUC9.png)
![](https://i.imgur.com/LUAFIg4.png)
# 5-171 SQL Server連線設定
![](https://i.imgur.com/3sOnerA.png)
# 5-172 遠端連線設定
![](https://i.imgur.com/XrIkUc3.png)
https://medium.com/@nishancw/how-to-enable-remote-connections-to-sql-server-dc5b6c812b5
# 5-173 Jdbc url設定
![](https://i.imgur.com/LpTHtLp.png)
# 5-174 Tomcat jndi DataSource 設定 for SQL Server
![](https://i.imgur.com/jSoAOsB.png)
# 5-175 web.xml設定
![](https://i.imgur.com/MOyFlvB.png)
# 5-176  Tomcat server的context.xml 設定 for SQL Server
![](https://i.imgur.com/tV0X2Y9.png)
# 5-177 JSTL
![](https://i.imgur.com/RqIlb4I.png)

# 5-178 JSTL五類功能
![](https://i.imgur.com/QcsZrUX.png)
https://www.javatpoint.com/jstl
https://www.tutorialspoint.com/jsp/jsp_standard_tag_library.htmhttps://www.oracle.com/javaee/5/tutorial/doc/bnakc.html
# 5-179 JSTL
![](https://i.imgur.com/w5qkLdE.png)
![](https://i.imgur.com/nWSKwJE.png)
# 5-180.181 JSTL
![](https://i.imgur.com/mM9Y9lc.png)
taglib
https://www.javatpoint.com/jstl-sql-setdatasource-tag
![](https://i.imgur.com/KzARfLG.png)
(參考222)
![](https://i.imgur.com/zFyuMBb.png)
(queryTest.jsp)
# 5-182 JSTL Core Tags List
![](https://i.imgur.com/0NKX1ki.png)
https://www.javatpoint.com/jstl-core-tags
# 5-183~185 流程處裡標籤
param.name參數 去getmomor這個參數![](https://i.imgur.com/Xsf0y2N.png)![](https://i.imgur.com/FzoIQAd.png)
![](https://i.imgur.com/XoEdr6F.png)
![](https://i.imgur.com/APLpvtk.png)
https://hackmd.io/iUMtsSB9ReqcUyq5WxlZfQ
forEach:https://www.javatpoint.com/jstl-core-forEach-tag![](https://i.imgur.com/VXhXL6Q.png)
# 5-186.187 流程處裡標籤
![](https://i.imgur.com/YRviy9I.png)
![](https://i.imgur.com/LwLPszO.png)
![](https://i.imgur.com/S9DU2uj.png)
# 5-188 錯誤處理標籤
![](https://i.imgur.com/87RocAQ.png)
https://www.javatpoint.com/jstl-core-catch-tag
(catchdemo.jsp)
# 5-189.190 網頁匯入標籤
![](https://i.imgur.com/X3Tz1Xb.png)
![](https://i.imgur.com/1n60y6R.png)
# 5-191 重新導向標籤
![](https://i.imgur.com/O8G3lOt.png)
# 5-192.193 URL重寫標籤
![](https://i.imgur.com/XXyR27l.png)![](https://i.imgur.com/elPSCJL.png)
# 5-194~197 屬性處理標籤
![](https://i.imgur.com/tduwF9d.png)![](https://i.imgur.com/LA5DFji.png)![](https://i.imgur.com/3qNSiQ7.png)![](https://i.imgur.com/tLDfHaH.png)
# 5-198 輸出標籤
![](https://i.imgur.com/lEVJbqj.png)
# 5-199 JSTL Format Tags List
![](https://i.imgur.com/fnUPZFC.png)
https://www.javatpoint.com/jstl-formatting-tags
(jstl4format.jsp)
https://docs.oracle.com/javase/tutorial/i18n/intro/quick.html
# 5-200 I18N相容格式標籤庫
i跟n之間有18個字
Localization ln中間有10個字
![](https://i.imgur.com/VisLOz6.png)
# 5-201~203 I18N基礎
I18NDemo
![](https://i.imgur.com/xAE6CZ0.png)
![](https://i.imgur.com/q6Y1bVh.png)![](https://i.imgur.com/ssJizz9.png)
https://docs.oracle.com/javase/tutorial/i18n/intro/quick.html
國際化![](https://i.imgur.com/SH5gnE8.png)
![](https://i.imgur.com/8EUHC6L.png)

變換語言
![](https://i.imgur.com/a1Xnjgi.png)
![](https://i.imgur.com/wxO44uF.png)
# 5-204 地區(Locale)資訊
![](https://i.imgur.com/QNOOO7U.png)
https://www.oracle.com/java/technologies/javase/jdk8-jre8-suported-locales.html
# 5-205 資源包(Resour bundle)
![](https://i.imgur.com/XRezzBT.png)
# 5-206 基礎名稱(Base name)
![](https://i.imgur.com/GxkCVBo.png)
# 5-207 native2ascii
![](https://i.imgur.com/l5lSVhv.png)
![](https://i.imgur.com/O1BJT9B.png)
# 5-208 ResourceBundle
![](https://i.imgur.com/Zoc3qxX.png)
# 5-209 訊息標籤
![](https://i.imgur.com/M6JaFkJ.png)
# 5-210 messages1.properties
![](https://i.imgur.com/yA9lRiE.png)
# 5-211.212 messages2.properties
![](https://i.imgur.com/2O7OTE8.png)![](https://i.imgur.com/1ekJdsV.png)
# 5-213 messages3.properties
![](https://i.imgur.com/axcyz6Z.png)
![](https://i.imgur.com/G2tZiOi.png)
# 5-214~217 地區標籤
![](https://i.imgur.com/d6l0foc.png)
![](https://i.imgur.com/KgNs1c9.png)
![](https://i.imgur.com/PFKKJF9.png)![](https://i.imgur.com/HWDurZf.png)
# 5-218~221 格式標籤
![](https://i.imgur.com/8Qck3RZ.png)
![](https://i.imgur.com/PNoZYfr.png)![](https://i.imgur.com/FpsmisS.png)![](https://i.imgur.com/PIMdsK8.png)
![](https://i.imgur.com/z06fdjK.png)
![](https://i.imgur.com/8kxmOUK.png)


