Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

XML VIEW OF JSP PAGE:

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is from jsp spec
Why <![CDATA is being used ???
cant i just say
<jsp:text><title>asdasd<title></jsp:text>
XML VIEW OF JSP PAGE:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:eg="http://java.apache.org/tomcat/examples-taglib"
xmlns:test="urn:jsptld:/tomcat/taglib"
xmlns:temp="urn:jsptld:/WEB-INF/tlds/my.tld"
version="1.2">
<jsp:text><![CDATA[<html>
<title>positiveTagLig</title>
<body>
]]></jsp:text>
<eg:test toBrowser="true" att1="Working>
<jsp:text>Positive test taglib directive</jsp:text>
</eg:test>
<jsp:text><![CDATA[
</body>
</html>
]]></jsp:text>
</jsp:root>
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi can u tell me how to use xml syntax with jsp
for example
<%="hello"%>
<%
int i=0;
%>
<% int i=0;%>
<% for(i=0;i<8;i++)
{%>
out.println(<%=i%> ;
<%
}
%>
<%="hello2"%>
gives the output
hello int i=0; out.println(0); out.println(1); out.println(2); out.println(3); out.println(4); out.println(5); out.println(6); out.println(7); hello2
but if i try with xml syntax
<jsp:expression>
"hello"
</jsp:expression>
<jsp:scriptlet>
int i=0;
</jsp:scriptlet>
<jsp:scriptlet> for(i=0;i<8;i++)
{</jsp:scriptlet>
out.println(<jsp:expression>i</jsp:expression> ;
<jsp:scriptlet>
}
</jsp:scriptlet>
it gives weird output
"hello" int i=0; for(i=0;i<8;i++) { out.println(i); }
how u r doing it with xml?
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shan java:
Why <![CDATA is being used ???


Because the XML contained in it isn't well-formed -- it contains XML opening tags "html" and "body" without corresponding closing tags. By using a CDATA section you tell the HTML parser to treat the content as flat character data, not as XML.

cant i just say
<jsp:text><title>asdasd<title></jsp:text>

Yes you can, as this is well-formed XML.
If you are unsure about the concept of well-formedness I'd recommend you read a good XML tutorial; you won't properly understand JSP XML format unless you understand XML.
- Peter
[ April 11, 2002: Message edited by: Peter den Haan ]
 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic