wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes mock exam question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "mock exam question" Watch "mock exam question" New topic
Author

mock exam question

Shreyas Reddy
Ranch Hand

Joined: Oct 09, 2003
Posts: 49
Which statements are true about the following XML-code on a JSP page:
<jsp:expression>"output"</jsp:expression>
<jsp:text>output</jsp:text>
A Error takes place
B It compiles fine.
C The code should be in a JSP scriptlet to work
D output output is printed on the screen
B and D are true. It is valid XML syntax.

Another question about tag-lib-uri.
the uri associated with a tag librayr appears in 3 places.
a. in the jsp file as
<%@ taglib uri="uri-in-jsp-file" prefix="xyz" %>
b. in the web.xml as
<taglib>
<taglib-uri>"uri-in-web-xml"</tablib-uri>
...
c. in the TLD file as
<taglib>
...
<uri>"uri-in-tld-file"</uri>
Do the three occurances of the uri must match for a given tag library?
Thanks,

My answer was "A", can someone explain. Is there a tag called jsp:text?
Anselm Paulinus
Ranch Hand

Joined: Sep 05, 2003
Posts: 389
Yes there is <jsp:text> in XML document for writing text to the browser in JSP pages
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683

Another question about tag-lib-uri.
the uri associated with a tag librayr appears in 3 places.
a. in the jsp file as
<%@ taglib uri="uri-in-jsp-file" prefix="xyz" %>
b. in the web.xml as
<taglib>
<taglib-uri>"uri-in-web-xml"</tablib-uri>
...
c. in the TLD file as
<taglib>
...
<uri>"uri-in-tld-file"</uri>
Do the three occurances of the uri must match for a given tag library?

In TLD file, the <uri> element is optional.
In the JSP file, the uri attibute value must match that in the taglib <taglib-uri> element. Here's an example which I've been using.
In JSP file:

In web.xml:

[ October 23, 2003: Message edited by: Roger Chung-Wee ]

SCJP 1.4, SCWCD 1.3, SCBCD 1.3
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mock exam question
 
Similar Threads
Doubts from Marcus Green Mock Exam
info attribute of page directive
<taglib> and uri doubt
#6 on Head First Mock Exam