Struts2.2.1 head Tag Example
Posted on: January 19, 2011 at 12:00 AM
In this tutorial,we will discuss about the head tag in struts2.2.1.

Struts2.2.1 head Tag Example

The <s:head> tag is used to renders parts of the HEAD section for an HTML file. This is useful as some themes require certain CSS and JavaScript includes.

<%@ taglib prefix="s" uri="/struts-tags" %>

<html>ADS_TO_REPLACE_1

              <head>

                       <s:head />

               </head>ADS_TO_REPLACE_2

<body>

If, for example, your page has ajax components integrated, without having the default theme set to ajax, you might want to use the head tag with 
theme="ajax" so that the typical ajax header setup will be included in the page.

<%@ taglib prefix="s" uri="/struts-tags" %>

<html>ADS_TO_REPLACE_3

             <head>
                     <title>My page</title>
                                 <s:head theme="ajax" calendarcss="calendar-green"/>
              </head>

<body>


The tag also includes the option to set a custom datepicker theme if needed. See calendarcss parameter for description for details.
If you use the ajax theme you can turn a debug flag on by setting the debug parameter to true.

<%@ taglib prefix="s" uri="/struts-tags" %>ADS_TO_REPLACE_4

<html>

           <head>

                       <title>My page</title>ADS_TO_REPLACE_5

                                   <s:head theme="ajax" debug="true"/>

          </head>

<body>

Related Tags for Struts2.2.1 head Tag Example:

Advertisements

Ads

 
Advertisement null

Ads