Docsity

JSP Standard Tag Library Part 3-Java Programming-Lecture Slides, Slides of Java Programming

Toggle sidebar
bg1
<c:out>
Evaluates an expression and outputs the result of the
evaluation to the current JspWriter object
If the result of the evaluation is a java.io.Reader object,
data is first read from the Reader object and then
written into the current JspWriter object
improved performance
Syntax
<c:out value="value" [escapeXml="{true|false}"]
[default="defaultValue"] />
If escapeXml is true, escape character conversion
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download JSP Standard Tag Library Part 3-Java Programming-Lecture Slides and more Slides Java Programming in PDF only on Docsity!

<c:out>

 Evaluates an expression and outputs the result of the evaluation to the current JspWriter object  If the result of the evaluation is a java.io.Reader object, data is first read from the Reader object and then written into the current JspWriter object  improved performance  Syntax  <c:out value="value" [escapeXml="{true|false}"] [default="defaultValue"] />  If escapeXml is true, escape character conversion

Example: <c:out>

quoted from /elsupport/Out.jsp

no cell phone specified

Example: <c:out>

quoted from /elsupport/Out.jsp

Database Access Tags

(SQL Tags)

.jsp Database Dynamic Content

MVC Architecture

Resource bundle identified by context parameter Beans SQL Business Logic

.jsp Database

SQL Tags

Query the database <sql:query> Easy access to result set Result ResultSupport Update the database <sql:update> <sql:transaction>

Example: <sql:setDataSource> for setting a table using PointBase <sql:setDataSource var="example" driver="com.pointbase.jdbc.jdbcUniversalDriver" url="jdbc:pointbase:server://localhost: 1092 /jstlsample; create=true" />

Example: <sql:transaction> &

<sql:update> from /sql/QueryDirect.jsp

<sql:transaction dataSource="${example}"> <sql:update var="newTable"> create table mytable ( nameid int primary key, name varchar( 80 ) ) </sql:update> <sql:update var="updateCount"> INSERT INTO mytable VALUES ( 1 ,'Paul Oakenfold') </sql:update> <sql:update var="updateCount"> INSERT INTO mytable VALUES ( 2 ,'Timo Maas') </sql:update> ... <sql:query var="deejays"> SELECT * FROM mytable </sql:query> </sql:transaction>

XML Tags

XML Tags

 Flow control  <x:choose>, <x:when>, <x:if>, <x:otherwise>  Iteration  <x:forEach>  General purpose  <x:out>  <x:set>  Parsing and Transformation  <x:parse>  <x:transform> with <x:param> subtags

Quick XPath

Review (Start)

Example XML Document Lux 1 swimming 23 M Den 1 cycling 18 F Den 2 sailing 27 M