• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp:include  RSS feed

 
riohk kurn
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just reading manning book, and I find it confusing in following question:
1. <jsp:include page="<%=testurl%>" />
2. <jsp:include page="%=testurl%" />
Since they both appear in the pervious section of the book and they are claimed as correct. However, in the quiz of the book, it said 1 is incorrect. But which one is correct? Thx!
 
trupti nigam
Ranch Hand
Posts: 640
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1 is correct.
trupti
 
riohk kurn
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh! I asked a stupid question. They are in different situations. One for jsp syntax, one for xml syntax. So, they can not be compared, and they are both correct in suitable situation, aren't they?
 
Maha Annadurai
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
In JSP (non-xml) format,
<jsp:include page="<%=pageUrl%>" /> is correct.
In XML format,
<%jsp:include page="%=pageUrl%" /> is correct.
Regards,
Maha Anna
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!