Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scriptless vs Tag Dependent

 
Mark Beavis
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys -

when declaring a body content type in a tag file what is the exact difference between "scriptless" and "tagdependent" (apart from the fact that scriptless is the default?

Thanks
mark...
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
scriptless :- it can contain any body except scripting(expression,scriptlet,....etc) language.But it can contain EL. The body part will include the result of EL expressions.

tagdependent :- it can contain anything, but its considered like any simple text.

example

Suppose we have a variable count=5.
myTag.tag file
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ tag body-content="scriptless[B]" %>
<jsp oBody var="content"/>

<pre:myTag>
The value of the variable count is :- ${count}
</pre:myTag>

now the value of [B]content
variable will be = The value of the variable count is :- 5


but if we specify body-content = tagdependent

value of content variable will be = "The value of the variable count is :- ${count}
"
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
scriptless :- it can contain any body except scripting(expression,scriptlet,....etc) language.But it can contain EL. The body part will include the result of EL expressions.

tagdependent :- it can contain anything, but its considered like any simple text.

example

Suppose we have a variable count=5.
myTag.tag file
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ tag body-content="scriptless" %>
<jsp oBody var="content"/>

<pre:myTag>
The value of the variable count is :- ${count}
</pre:myTag>

now the value of content variable will be = The value of the variable count is :- 5


but if we specify body-content = tagdependent

value of content variable will be = "The value of the variable count is :- ${count}
"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic