• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tag file - tagdependent and scripting

 
Radmika Arunachalam
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Quick! Before anybody notices! Cover it up with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic