L12-JSTL - Session 12 JSTL Session 12 JSP Tag Library...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Session 12 – JSTL 10/20/2010 1 © Robert Kelly, 2001-2010 Session 12 JSP Tag Library (JSTL) 1 Reading & Reference Reading Head First – Chap 9, pages 439-474 Reference (skip internationalization and sql sections Reference (skip internationalization and sql sections) Java EE 5 Tutorial (Chapter 7) - link on CSE336 Web site (References Section) JavaWorld – www.javaworld.com/javaworld/jw-02-2003/jw-0228-jstl.html Java Developers Journal (requires registration) www.sys-con.com/story/?storyid=37549 Sun JSP / Tag API – (for download) © Robert Kelly, 2001-2010 2 Link to the download site is in the References section of the CSE336 home page Collections java.sun.com/docs/books/tutorial/collections/
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Session 12 – JSTL 10/20/2010 2 © Robert Kelly, 2001-2010 HW 4 – Project Form HW 4 requires a clear approach to testing and development Requires an understanding of Requires an understanding of objects that are passed and objects that are shared Your debugging should test your assumptions about the passed and shared objects © Robert Kelly, 2001-2010 3 We will build a JSP using JSTL that may help you in your debugging for HW#4 HW 4 Approach For now, you can use a redirect to send control from the servlet to a JSP Remember that redirect is an http header that you set in your response (with a URL servlet Bean response (with a URL) © Robert Kelly, 2001-2010 4 Form JSP Page OK JSP Page Debug JSP Page Use a forward if you want to read ahead
Background image of page 2
Session 12 – JSTL 10/20/2010 3 © Robert Kelly, 2001-2010 Web Architecture Web layer Data sources Clients JSP Page Bean JSTL Tag XML JDBC servlet Custom © Robert Kelly, 2001-2010 5 EJB JSP Page JSTL Background JSTL tags are valid XML JSTL contains actions for common tasks Iteration Session tracking Redirect XML Remember – the development theme is “no scriptlets” © Robert Kelly, 2001-2010 6 Etc. You will use EL expressions in your JSTL tags
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Session 12 – JSTL 10/20/2010 4 © Robert Kelly, 2001-2010 Libraries JSTL has 5 standard tag libraries Core Internationalization/format XML SQL Functions (primarily string manipulations) © Robert Kelly, 2001-2010 7 We refer to JSTL tags as actions (to distinguish them from static tags) Example – Form Debugger A JSP that you can use during testing to verify the state of your objects when you submit a request from your browser © Robert Kelly, 2001-2010 8 To use the form debugger, you can send your form request to this JSP instead of to your servlet
Background image of page 4
Session 12 – JSTL 10/20/2010 5 © Robert Kelly, 2001-2010 Example – Form Debugger Output The JSP will output the collection of parameter name/value pairs in a table with each parameter name in the first column and each parameter value in the second column © Robert Kelly, 2001-2010 9 Example – Form Debug JSP <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> Declares the JSTL core tag librar <title>FormTester</title> <link rel="stylesheet" type="text/css“ href="http://www.cs.sunysb.edu/~cse336/Cse336.css"/> </head> <body> <h2>Testing the Input Form</h2> <table> <tr>
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/22/2011 for the course CSE 336 taught by Professor Kelly,r during the Fall '08 term at SUNY Stony Brook.

Page1 / 19

L12-JSTL - Session 12 JSTL Session 12 JSP Tag Library...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online