aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes tag file - tagdependent and scripting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "tag file - tagdependent and scripting" Watch "tag file - tagdependent and scripting" New topic
Author

tag file - tagdependent and scripting

Radmika Arunachalam
Ranch Hand

Joined: Mar 29, 2004
Posts: 45
Hi,
I have sample code as below..

// Header.tag


// test.jsp


I getting "${test} in teh browser but not the scripting ("Hi Viewers How are u?").. Since my body-content is tagdependent, why it is not displaying scripting? I know in HFSJ given "scripting not alowed in the body of the tag files" but what about if said tagdependent - is it not mean body is implementation dependent and processed by tag itself..

Any Idea why it is behaving like this? I am not able to find topics related to this in spec.. Thanks in advance

Thanks
Radmika
Murali Krishna Vyamasani
Greenhorn

Joined: Dec 05, 2004
Posts: 3
Hi Radmika,
When you say <%@ tag body-content="tagdependent" %> the body content is treated like plain text so EL,tags and scripts will not be evaluated. So the El tag ${text} is being printed because it is just treated as normal text.

This code <%= "Hi Viewers How are u? " %> is an expression so it is not being evaluated.

U can also refer HFSJ pg.498 for information on this.

Ranchers correct me if I am wrong.

Murali.
Murali Krishna Vyamasani
Greenhorn

Joined: Dec 05, 2004
Posts: 3
Hi radmika,
I am sorry. I just realised suddenly that when u say tagdependent everything in the body should be treated as normal text.
So part of my statement is wrong

" So the El tag ${text} is being printed because it is just treated as normal text. "

It should also be ignored. I don't know why it is printing.

The output that you got would be correct if the body-content were scriptless which is the default value.

Hope somebody clears it.

Murali.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tag file - tagdependent and scripting
 
Similar Threads
Doubt on tagfile body content
HFSJ - Custom Tag Development - Question 17 (Page 567)
body-content
Scripting elements in JspFragment
not getting the EL