Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock exam question

 
Shreyas Reddy
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 390
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes there is <jsp:text> in XML document for writing text to the browser in JSP pages
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic