aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes how comws varaible in the tag 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 "how comws varaible in the tag" Watch "how comws varaible in the tag" New topic
Author

how comws varaible in the tag

Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
I have a doubt regarding ho many possible child elements are there for the <tag> element in the .tld file.

For EXAMPLE:

In HFSJ book, there are not mention anything about <variable> element and its child element?

What is the menaing of <variable> and how to use it in the jsp page? Please give a sample coding of how to use it in the JSP?

What are the other possible child elements for <variable> element? What are the other possible values for the <scope>?Where can i get more infomation regarding it?

What is the meaning of AT_BEGIN.. in the <scope>?


Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
Kevin DesLauriers
Ranch Hand

Joined: Nov 28, 2005
Posts: 43
I use Charles Lyons as my secondary resource. I am using it to help me answer your questions.

I have a doubt regarding how many possible child elements are there for the <tag> element in the .tld file:
description, display-name, icon, name, tag-class, tei-class, body-content, variable, attribute, dynamic-attribute, example, and tag-extension.


In HFSJ book, there are not mention anything about <variable> element and its child element?

What is the meaing of <variable> and how to use it in the jsp page? Please give a sample coding of how to use it in the JSP?
The variable element is used to specify the scripting variables exposed by the tag. Using this element in the TLD is the easiest way to do that. jsp:useBean is an action that exposes a scripting variable for the JSP to use after its invocation.

If I am correct, assuming that useBean stores the bean in a scoped attribute it then supplying a variable element allows you to have access to a scripting element in your JSP (translated servlet) that is synchronized with the scoped attribute. The scope element then defines how the synchronization works. It defines where the scripting variable will be declared in the translated servlet.

AT_BEGIN variables are created in servlet code(translated JSP -> servlet) before the tag is invoked allowing the variable to exist throughout the tags life and after it has finished being invoked. The scripting variable is synchronized after every iterarion of the body and again after the tag has been completed (after doEndTag() in a classic tag)

NESTED variables are created before the handler is invoked and does not exist after it has completed. It is only synchronized each time the body has been processed. Once the tag has completed the scripting variable no longer exists in the JSP.

AT_END variables are created when the tag has completed and are created once the doEndTag has returned.


Example of a translated servlet using scope AT_BEGIN:


What are the other possible child elements for <variable> element?
description, variable-class, declare, scope (name-given|name-from-attribute)

What are the other possible values for the <scope>?
[I]See above

Where can i get more infomation regarding it?
Charles Lyons - Sun Certified Web Component Developer Study Companion
What is the meaning of AT_BEGIN.. in the <scope>?
I hope I answered that above

Kevin
[ February 11, 2007: Message edited by: Kevin DesLauriers ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how comws varaible in the tag
 
Similar Threads
Class not found..
TLD files variable element
SchemaLocation Error In Eclipse IDE
jsp tag libraries problem