Originally posted by Sudd Ghosh:
Hi -
I am trying some escape sequences from the Manning book, chapter 12, section 12.1.4.
My JSP code mydate.jsp (the part inside the html body) is :
The opening tag of a scriptlet is <\%
The closing tag of a scriptlet is %>
<BR>
<%= "The opening tag of a scriptlet is <%" %>
<%= "The closing tag of a scriptlet is %\>" %>
The relevant portion of the generated servlet mydate_jsp.java from the "tomcat/work.." directory is :
out.write("<BR>\r\n-->\r\nThe opening tag of a scriptlet is ");
out.write("<%\r\nThe closing tag of a scriptlet is %>\r\n");
out.write("<BR>\r\n");
out.print( "The opening tag of a scriptlet is <%" );
out.write("\r\n");
out.print( "The closing tag of a scriptlet is %>" );
out.write("\r\n");
AND the output on running http://localhost:8080/myExamples/jsp/mydate.jsp
is :
The opening tag of a scriptlet is
The opening tag of a scriptlet is
(which is not correct).
I don't know where I'm going wrong with this, but somehow I'm not able to use the backslash escape properly. I have coded it exactly as per the aforementioned section of the Manning book.
Thanks, Sudd
Originally posted by Sudd Ghosh:
Hi -
I am trying some escape sequences from the Manning book, chapter 12, section 12.1.4.
My JSP code mydate.jsp (the part inside the html body) is :
The opening tag of a scriptlet is <\%
The closing tag of a scriptlet is %>
<BR>
<%= "The opening tag of a scriptlet is <%" %>
<%= "The closing tag of a scriptlet is %\>" %>
The relevant portion of the generated servlet mydate_jsp.java from the "tomcat/work.." directory is :
out.write("<BR>\r\n-->\r\nThe opening tag of a scriptlet is ");
out.write("<%\r\nThe closing tag of a scriptlet is %>\r\n");
out.write("<BR>\r\n");
out.print( "The opening tag of a scriptlet is <%" );
out.write("\r\n");
out.print( "The closing tag of a scriptlet is %>" );
out.write("\r\n");
AND the output on running http://localhost:8080/myExamples/jsp/mydate.jsp
is :
The opening tag of a scriptlet is
The opening tag of a scriptlet is
(which is not correct).
I don't know where I'm going wrong with this, but somehow I'm not able to use the backslash escape properly. I have coded it exactly as per the aforementioned section of the Manning book.
Thanks, Sudd