aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt on tagfile body content Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Doubt on tagfile body content" Watch "Doubt on tagfile body content" New topic
Author

Doubt on tagfile body content

MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
This is regarding tag files.

"A tag body cannot use scripting elements"

what does it mean?..can anyone please explain this...


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Originally posted by Vinod NS:
This is regarding tag files.

"A tag body cannot use scripting elements"

what does it mean?..can anyone please explain this...


This means that when you use the tag file tag in JSP body, The body encloed in the open and end tag can not have scripting elements.



thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
it means that i can't do like this?

<my:Header>
<%="Hello"%>
</my:Header>


But i tried the above code and did'nt get any errors.

<%@ attribute name="attr" required="false" rtexprvalue="true" %>
<%@ tag body-content="tagdependent" %>
This is header file.
<jsp oBody/>



Thanks.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

Originally posted by Vinod NS:
it means that i can't do like this?

<my:Header>
<%="Hello"%>
</my:Header>


But i tried the above code and did'nt get any errors.

<%@ attribute name="attr" required="false" rtexprvalue="true" %>
<%@ tag body-content="tagdependent" %>
This is header file.
<jsp oBody/>



Thanks.


Because you set the body-content to tagdependent. If the body content is tagdependent, the body is not interpreted by the container. Try scriptless value, which is default, or remove the tag directive from your tag file. It is surely error.

Thanks
[ March 09, 2006: Message edited by: Narendra Dhande ]
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
yes..now it is clear.

so if the body content is 'tagdependent' then we can put anything in the body of a tag.

But whatever you put in the body will treated as plain text.


Thanks.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Doubt on tagfile body content
 
Similar Threads
What does body-content type is JSP mean?
NoClassDefFoundError with c:set using body content
Tag file problem
Alert Box in JSP
Struts2: Compare request parameter not working