Quantcast
Channel: 質問!ITmedia 新着質問(Java/253)
Viewing all articles
Browse latest Browse all 2439

動的プルダウン、テーブルjsp

$
0
0
Jspでプルダウンメニューを選択したものをテーブルに反映するものを作成しています。 Servletでは Connection conn = null; try{ conn = DBManager.getConnection(); Persist persist = new Persist(conn); List store = persist.readList(Store.class,"select store_id,store_name,store_address FROM m_store"); List locationView = persist.readList(Location.class,"SELECT m_location.location_id,m_location.free_space,m_location.customer_id FROM m_location"); List CustomerView = persist.readList(Customer.class,"SELECT customer_name,customer_id FROM m_customer"); request.setAttribute("store",store); request.setAttribute("locations",locationView); request.setAttribute("customers",CustomerView); } finally { DBManager.close(conn); } return "/WEB-INF/view/storeView.jsp"; } } jspのスクリプトとテーブルは <%@ include file="/WEB-INF/view/header.jsp" %>
<%for(Location locate : locations){%> <%}%>
空:
<%String storeId = request.getParameter("storeId");%>

Viewing all articles
Browse latest Browse all 2439

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>