1 / 51

Database Setup

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.

Download Presentation

Database Setup

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Database Setup

  2. SQL Query 결과

  3. Product table data 추가

  4. 다운로드...

  5. Run SQL button

  6. 결과

  7. New File: JDBC resource

  8. !

  9. !

  10. 암호

  11. glassfish-resources.xml

  12. glassfish-resources.xml

  13. Deploy !

  14. Add Reference to web.xml

  15. Add Reference to glassfish-web.xml

  16. Create jsp to test data source

  17. Palette Window: [ctrl + shift] + 8

  18. JSTL Java Server Pages Standard Tag Library JSTL directives:

  19. Context Parameters • web deployment descriptor (web.xml)안에 name-value 정의합니다:

  20. 확인 In index.jsp:

  21. JSP Expression Language • JSP EL • initParam은 EL 정의됀 객체 입니다 • EL 경계 기호:${....}

  22. 결과

  23. Db Query in index.jsp

  24. 변수 categories

  25. 변수 categories categories 변수는 javax.servlet.jsp.jstl.sql.Resultinterface를 구현합니다

  26. JSTL forEach

  27. javax.servlet.jsp.jstl.sql.Result ${categories.rows} is the same as categories.getRows();

  28. JAVA EL isLimitedByMaxRows() isLimitedByMaxRows() ${limitedByMaxRows} limitedByMaxRows LimitedByMaxRows() limitedByMaxRows() LimitedByMaxRows() limitedByMaxRows()

  29. category.jsp

  30. category.jsp • Retrieve data using JSTL sql library • Display data using JSTL core library and Expression Language (EL)

  31. Db Query

  32. pageContext은? • implicit Object • pageContext.requestHttpServletRequest객체 입니다 • pageContext.request.queryString:request.getQueryString() 메소드를 호출합니다

  33. Request Path Elements http://www.bob.com/NiceDoggy/category?id=1 context path request.getContextPath() servlet path request.getServletPath() pathInfo request.getPathInfo()

  34. Request Path Elements http://www.bob.com/NiceDoggy/category?3 request.getContextPath() /NiceDoggy request.getServletPath() /category request.getPathInfo() ?3 request.getQueryString() 3

  35. 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}

  36. 2ndDb Query API:

  37. 3rdDb Query

More Related