Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

What is the use of <template:get/> and <template:put/> tag defined by Template  tag library in Struts framework?
The <template:get/> tag is used to retrieve the contenes of a bean stored in the request scope, with the intention of replacing the tag instance with the contents of the retrieved bean. It is used to define the actual template JSP that will be referenced by the <template:insert/> tag. The bean being retrieved is assumed to have been placed on the request by a <template:put/> tag. The <template:get/> tag has no body and suppots three attributes:
  * name : Identifies the name of the request attributes to be retrieved. The name attribute should match the name of name attribute of the <template:put/> tag.(Required)
  * role : Specifies the role in which the user must exist for this tag to be evaluated.
  * If set to true, results in the flushing of the response buffer prior to the inclusion of the specified request attribute.

The <template:put/> tag is used to store the content of a particular URL or text (URI or text) into the request scope. This tag is the parent to one or more put tags. The put tags specify the content to be inserted into the template. The layout the content is determined by get tags placed in the template. The <template:put/> tag has no body and supports four attribute:
  * name : Identifies the name of the attribute to be stored in the request.
  * role : Specifies the role in which the user must exists for this tag to be evaluated.
  * content : Specifies the content that will be stored in the request.
  * direct : If set to true, indicates that the content attribute or body is printed to the request.