• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

mock exam question

 
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?
 
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
 
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 ]
 
They weren't very bright, but they were very, very big. Ad contrast:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic