Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

XML equivalent tags!!  RSS feed

 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
Determine the output of the following two pieces of code...
1)Case 1: Using xml equvalent tags
**********************************
<jsp:scriptlet>
if(true == false){
</jsp:scriptlet>
<jsp:forward page="/MyJsp/1.jsp"/>
<jsp:scriptlet>
}
else
{
</jsp:scriptlet>
<jsp:forward page="/MyJsp/2.jsp"/>
<jsp:scriptlet>
}
</jsp:scriptlet>
1.jsp and 2.jsp just print of their respective file names in html
*************************************************
2)Case 2:Using JSP syntax
*************************
<%
if(true == false){
%>
<jsp:forward page="/MyJsp/1.jsp"/>
<%
}
else
{
%>
<jsp:forward page="/MyJsp/2.jsp"/>
<%
}
%>
************************************************
Case 1 using xml equiv is directing me to 1.jsp and Case 2 is directing me to 2.jsp!!
Am i doing something terribly wrong here or is it a bug!!
Thanks,
Manjunath
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case 1 you have neglected to include the root element so, the JSP parser ignores your tags as unidentified HTML tags. Change 1 to

Retry it.
[ January 31, 2002: Message edited by: Carl Trusiak ]
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Case 1 using xml equiv is directing me to 1.jsp and Case 2 is directing me to 2.jsp!!
Am i doing something terribly wrong here or is it a bug!!

doing something terribly wrong here!!!
- satya
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Carl and thanks once again satya..
 
This is my favorite show. And this is my favorite tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!