510 likes | 585 Views
Database Setup. SQL Query. 결과. Product table data 추가. 다운로드. Run SQL button. 결 과. New File: JDBC resource. !. !. 암 호. glassfish-resources.xml. glassfish-resources.xml. Deploy. !. Add Reference to web.xml. Add Reference to glassfish-web.xml. Create jsp to test data source.
E N D
SQL Query 결과
Deploy !
Palette Window: [ctrl + shift] + 8
JSTL Java Server Pages Standard Tag Library JSTL directives:
Context Parameters • web deployment descriptor (web.xml)안에 name-value 정의합니다:
확인 In index.jsp:
JSP Expression Language • JSP EL • initParam은 EL 정의됀 객체 입니다 • EL 경계 기호:${....}
변수 categories categories 변수는 javax.servlet.jsp.jstl.sql.Resultinterface를 구현합니다
javax.servlet.jsp.jstl.sql.Result ${categories.rows} is the same as categories.getRows();
JAVA EL isLimitedByMaxRows() isLimitedByMaxRows() ${limitedByMaxRows} limitedByMaxRows LimitedByMaxRows() limitedByMaxRows() LimitedByMaxRows() limitedByMaxRows()
category.jsp • Retrieve data using JSTL sql library • Display data using JSTL core library and Expression Language (EL)
pageContext은? • implicit Object • pageContext.requestHttpServletRequest객체 입니다 • pageContext.request.queryString:request.getQueryString() 메소드를 호출합니다
Request Path Elements http://www.bob.com/NiceDoggy/category?id=1 context path request.getContextPath() servlet path request.getServletPath() pathInfo request.getPathInfo()
Request Path Elements http://www.bob.com/NiceDoggy/category?3 request.getContextPath() /NiceDoggy request.getServletPath() /category request.getPathInfo() ?3 request.getQueryString() 3
Request Path Elements http://www.bob.com/NiceDoggy/category?3 request.getContextPath() ${pageContext.request.contextPath} request.getServletPath() ${pageContext.request.servletPath} request.getPathInfo() ${pageContext.request.pathInfo} request.getQueryString() ${pageContext.request.queryString}
2ndDb Query API: