http://git-wip-us.apache.org/repos/asf/struts-site/blob/2b2ec9b3/content/tag-developers/debug-tag.html ---------------------------------------------------------------------- diff --git a/content/tag-developers/debug-tag.html b/content/tag-developers/debug-tag.html new file mode 100644 index 0000000..d89dcd0 --- /dev/null +++ b/content/tag-developers/debug-tag.html @@ -0,0 +1,187 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="Date-Revision-yyyymmdd" content="20140918"/> + <meta http-equiv="Content-Language" content="en"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + + <title>Tag Developers Guide (WIP)</title> + + <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic" rel="stylesheet" type="text/css"> + <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> + <link href="/css/main.css" rel="stylesheet"> + <link href="/css/custom.css" rel="stylesheet"> + <link href="/highlighter/github-theme.css" rel="stylesheet"> + + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script type="text/javascript" src="/bootstrap/js/bootstrap.js"></script> + <script type="text/javascript" src="/js/community.js"></script> +</head> +<body> + +<a href="http://github.com/apache/struts" class="github-ribbon"> + <img style="position: absolute; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"> +</a> + +<header> + <nav> + <div role="navigation" class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" data-toggle="collapse" data-target="#struts-menu" class="navbar-toggle"> + Menu + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a href="/index.html" class="navbar-brand logo"><img src="/img/struts-logo.svg"></a> + </div> + <div id="struts-menu" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Home<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/index.html">Welcome</a></li> + <li><a href="/downloads.html">Downloads</a></li> + <li><a href="/announce.html">Announcements</a></li> + <li><a href="http://www.apache.org/licenses/">License</a></li> + <li><a href="http://apache.org/foundation/thanks.html">Thanks!</a></li> + <li><a href="http://apache.org/foundation/sponsorship.html">Sponsorship</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Support<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/mail.html">User Mailing List</a></li> + <li><a href="https://issues.apache.org/jira/browse/WW">Issue Tracker</a></li> + <li><a href="/security.html">Reporting Security Issues</a></li> + <li class="divider"></li> + <li><a href="/maven/project-info.html">Project info</a></li> + <li><a href="/maven/struts2-core/dependencies.html">Struts Core dependencies</a></li> + <li><a href="/maven/struts2-plugins/modules.html">Plugin dependencies</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Documentation<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/birdseye.html">Birds Eye</a></li> + <li><a href="/primer.html">Key Technologies</a></li> + <li><a href="/kickstart.html">Kickstart FAQ</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/WW/Home">Wiki</a></li> + <li class="divider"></li> + <li><a href="/getting-started/">Getting Started</a></li> + <li><a href="/security/">Security Guide</a></li> + <li><a href="/core-developers/">Core Developers Guide</a></li> + <li><a href="/tag-developers/">Tag Developers Guide</a></li> + <li><a href="/maven-archetypes/">Maven Archetypes</a></li> + <li><a href="/plugins/">Plugins</a></li> + <li class="divider"></li> + <li><a href="/maven/struts2-core/apidocs/index.html">Struts Core API</a></li> + <li><a href="/docs/plugins.html">Plugin APIs</a></li> + <li><a href="/docs/tag-reference.html">Tag reference</a></li> + <li><a href="http://cwiki.apache.org/S2PLUGINS/home.html">Plugin registry</a></li> + <li class="divider"></li> + <li><a href="/docs/tutorials.html">Tutorials - DEPRECATED</a></li> + <li><a href="/docs/faqs.html">FAQs - DEPRECATED</a></li> + <li><a href="/docs/guides.html">Guides - DEPRECATED</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Contributing<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/youatstruts.html">You at Struts</a></li> + <li><a href="/helping.html">How to Help FAQ</a></li> + <li><a href="/dev-mail.html">Development Lists</a></li> + <li class="divider"></li> + <li><a href="/submitting-patches.html">Submitting patches</a></li> + <li><a href="/builds.html">Source Code</a></li> + <li><a href="/coding-standards.html">Coding standards</a></li> + <li class="divider"></li> + <li><a href="/releases.html">Release Guidelines</a></li> + <li><a href="/bylaws.html">PMC Charter</a></li> + <li><a href="/volunteers.html">Volunteers</a></li> + <li><a href="https://git-wip-us.apache.org/repos/asf?p=struts.git">Source Repository</a></li> + </ul> + </li> + <li class="apache"><a href="http://www.apache.org/"><img src="/img/apache.png"></a></li> + </ul> + </div> + </div> + </div> + </nav> +</header> + + +<article class="container"> + <section class="col-md-12"> + <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/debug-tag.md" title="Edit this page on GitHub">Edit on GitHub</a> + <h1 id="debug">debug</h1> + +<p>Outputs the content of the Value Stack.</p> + + </section> +</article> + + +<footer class="container"> + <div class="col-md-12"> + Copyright © 2000-2016 <a href="http://www.apache.org/">The Apache Software Foundation </a>. + All Rights Reserved. + </div> + <div class="col-md-12"> + Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project logos are + trademarks of The Apache Software Foundation. + </div> + <div class="col-md-12">Logo and website design donated by <a href="https://softwaremill.com/">SoftwareMill</a>.</div> +</footer> + +<script>!function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (!d.getElementById(id)) { + js = d.createElement(s); + js.id = id; + js.src = "//platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } +}(document, "script", "twitter-wjs");</script> +<script src="https://apis.google.com/js/platform.js" async="async" defer="defer"></script> + +<div id="fb-root"></div> + +<script>(function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); + js.id = id; + js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; + fjs.parentNode.insertBefore(js, fjs); +}(document, 'script', 'facebook-jssdk'));</script> + + +<script> +$(function() { + return $("h2, h3, h4, h5, h6").each(function(i, el) { + var $el, id; + $el = $(el); + id = $el.attr('id'); + if (id) { + $el.removeAttr('id'); + return $el.before($("<a />").addClass('anchor').attr('name', id)); + } + }); +}); +</script> + +</body> +</html>
http://git-wip-us.apache.org/repos/asf/struts-site/blob/2b2ec9b3/content/tag-developers/else-tag.html ---------------------------------------------------------------------- diff --git a/content/tag-developers/else-tag.html b/content/tag-developers/else-tag.html new file mode 100644 index 0000000..e59820c --- /dev/null +++ b/content/tag-developers/else-tag.html @@ -0,0 +1,212 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="Date-Revision-yyyymmdd" content="20140918"/> + <meta http-equiv="Content-Language" content="en"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + + <title>Tag Developers Guide (WIP)</title> + + <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic" rel="stylesheet" type="text/css"> + <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> + <link href="/css/main.css" rel="stylesheet"> + <link href="/css/custom.css" rel="stylesheet"> + <link href="/highlighter/github-theme.css" rel="stylesheet"> + + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script type="text/javascript" src="/bootstrap/js/bootstrap.js"></script> + <script type="text/javascript" src="/js/community.js"></script> +</head> +<body> + +<a href="http://github.com/apache/struts" class="github-ribbon"> + <img style="position: absolute; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"> +</a> + +<header> + <nav> + <div role="navigation" class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" data-toggle="collapse" data-target="#struts-menu" class="navbar-toggle"> + Menu + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a href="/index.html" class="navbar-brand logo"><img src="/img/struts-logo.svg"></a> + </div> + <div id="struts-menu" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Home<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/index.html">Welcome</a></li> + <li><a href="/downloads.html">Downloads</a></li> + <li><a href="/announce.html">Announcements</a></li> + <li><a href="http://www.apache.org/licenses/">License</a></li> + <li><a href="http://apache.org/foundation/thanks.html">Thanks!</a></li> + <li><a href="http://apache.org/foundation/sponsorship.html">Sponsorship</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Support<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/mail.html">User Mailing List</a></li> + <li><a href="https://issues.apache.org/jira/browse/WW">Issue Tracker</a></li> + <li><a href="/security.html">Reporting Security Issues</a></li> + <li class="divider"></li> + <li><a href="/maven/project-info.html">Project info</a></li> + <li><a href="/maven/struts2-core/dependencies.html">Struts Core dependencies</a></li> + <li><a href="/maven/struts2-plugins/modules.html">Plugin dependencies</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Documentation<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/birdseye.html">Birds Eye</a></li> + <li><a href="/primer.html">Key Technologies</a></li> + <li><a href="/kickstart.html">Kickstart FAQ</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/WW/Home">Wiki</a></li> + <li class="divider"></li> + <li><a href="/getting-started/">Getting Started</a></li> + <li><a href="/security/">Security Guide</a></li> + <li><a href="/core-developers/">Core Developers Guide</a></li> + <li><a href="/tag-developers/">Tag Developers Guide</a></li> + <li><a href="/maven-archetypes/">Maven Archetypes</a></li> + <li><a href="/plugins/">Plugins</a></li> + <li class="divider"></li> + <li><a href="/maven/struts2-core/apidocs/index.html">Struts Core API</a></li> + <li><a href="/docs/plugins.html">Plugin APIs</a></li> + <li><a href="/docs/tag-reference.html">Tag reference</a></li> + <li><a href="http://cwiki.apache.org/S2PLUGINS/home.html">Plugin registry</a></li> + <li class="divider"></li> + <li><a href="/docs/tutorials.html">Tutorials - DEPRECATED</a></li> + <li><a href="/docs/faqs.html">FAQs - DEPRECATED</a></li> + <li><a href="/docs/guides.html">Guides - DEPRECATED</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Contributing<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/youatstruts.html">You at Struts</a></li> + <li><a href="/helping.html">How to Help FAQ</a></li> + <li><a href="/dev-mail.html">Development Lists</a></li> + <li class="divider"></li> + <li><a href="/submitting-patches.html">Submitting patches</a></li> + <li><a href="/builds.html">Source Code</a></li> + <li><a href="/coding-standards.html">Coding standards</a></li> + <li class="divider"></li> + <li><a href="/releases.html">Release Guidelines</a></li> + <li><a href="/bylaws.html">PMC Charter</a></li> + <li><a href="/volunteers.html">Volunteers</a></li> + <li><a href="https://git-wip-us.apache.org/repos/asf?p=struts.git">Source Repository</a></li> + </ul> + </li> + <li class="apache"><a href="http://www.apache.org/"><img src="/img/apache.png"></a></li> + </ul> + </div> + </div> + </div> + </nav> +</header> + + +<article class="container"> + <section class="col-md-12"> + <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/else-tag.md" title="Edit this page on GitHub">Edit on GitHub</a> + <h1 id="else">else</h1> + +<p>Please make sure you have read the <a href="#PAGE_13927">Tag Syntax</a> document and understand how tag attribute syntax works.</p> + +<table> + <tbody> + <tr> + </tr> + </tbody> +</table> + +<p><strong>Description</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=javadoc|javadoc=true|url=org.apache.struts2.components.Else</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<p><strong>Parameters</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=tagattributes|javadoc=false|url=struts2-tags/else.html</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<p><strong>Examples</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=example|lang=xml|javadoc=true|url=org.apache.struts2.components.Else</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + + </section> +</article> + + +<footer class="container"> + <div class="col-md-12"> + Copyright © 2000-2016 <a href="http://www.apache.org/">The Apache Software Foundation </a>. + All Rights Reserved. + </div> + <div class="col-md-12"> + Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project logos are + trademarks of The Apache Software Foundation. + </div> + <div class="col-md-12">Logo and website design donated by <a href="https://softwaremill.com/">SoftwareMill</a>.</div> +</footer> + +<script>!function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (!d.getElementById(id)) { + js = d.createElement(s); + js.id = id; + js.src = "//platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } +}(document, "script", "twitter-wjs");</script> +<script src="https://apis.google.com/js/platform.js" async="async" defer="defer"></script> + +<div id="fb-root"></div> + +<script>(function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); + js.id = id; + js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; + fjs.parentNode.insertBefore(js, fjs); +}(document, 'script', 'facebook-jssdk'));</script> + + +<script> +$(function() { + return $("h2, h3, h4, h5, h6").each(function(i, el) { + var $el, id; + $el = $(el); + id = $el.attr('id'); + if (id) { + $el.removeAttr('id'); + return $el.before($("<a />").addClass('anchor').attr('name', id)); + } + }); +}); +</script> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/struts-site/blob/2b2ec9b3/content/tag-developers/elseif-tag.html ---------------------------------------------------------------------- diff --git a/content/tag-developers/elseif-tag.html b/content/tag-developers/elseif-tag.html new file mode 100644 index 0000000..bb3b24c --- /dev/null +++ b/content/tag-developers/elseif-tag.html @@ -0,0 +1,212 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="Date-Revision-yyyymmdd" content="20140918"/> + <meta http-equiv="Content-Language" content="en"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + + <title>Tag Developers Guide (WIP)</title> + + <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic" rel="stylesheet" type="text/css"> + <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> + <link href="/css/main.css" rel="stylesheet"> + <link href="/css/custom.css" rel="stylesheet"> + <link href="/highlighter/github-theme.css" rel="stylesheet"> + + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script type="text/javascript" src="/bootstrap/js/bootstrap.js"></script> + <script type="text/javascript" src="/js/community.js"></script> +</head> +<body> + +<a href="http://github.com/apache/struts" class="github-ribbon"> + <img style="position: absolute; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"> +</a> + +<header> + <nav> + <div role="navigation" class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" data-toggle="collapse" data-target="#struts-menu" class="navbar-toggle"> + Menu + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a href="/index.html" class="navbar-brand logo"><img src="/img/struts-logo.svg"></a> + </div> + <div id="struts-menu" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Home<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/index.html">Welcome</a></li> + <li><a href="/downloads.html">Downloads</a></li> + <li><a href="/announce.html">Announcements</a></li> + <li><a href="http://www.apache.org/licenses/">License</a></li> + <li><a href="http://apache.org/foundation/thanks.html">Thanks!</a></li> + <li><a href="http://apache.org/foundation/sponsorship.html">Sponsorship</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Support<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/mail.html">User Mailing List</a></li> + <li><a href="https://issues.apache.org/jira/browse/WW">Issue Tracker</a></li> + <li><a href="/security.html">Reporting Security Issues</a></li> + <li class="divider"></li> + <li><a href="/maven/project-info.html">Project info</a></li> + <li><a href="/maven/struts2-core/dependencies.html">Struts Core dependencies</a></li> + <li><a href="/maven/struts2-plugins/modules.html">Plugin dependencies</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Documentation<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/birdseye.html">Birds Eye</a></li> + <li><a href="/primer.html">Key Technologies</a></li> + <li><a href="/kickstart.html">Kickstart FAQ</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/WW/Home">Wiki</a></li> + <li class="divider"></li> + <li><a href="/getting-started/">Getting Started</a></li> + <li><a href="/security/">Security Guide</a></li> + <li><a href="/core-developers/">Core Developers Guide</a></li> + <li><a href="/tag-developers/">Tag Developers Guide</a></li> + <li><a href="/maven-archetypes/">Maven Archetypes</a></li> + <li><a href="/plugins/">Plugins</a></li> + <li class="divider"></li> + <li><a href="/maven/struts2-core/apidocs/index.html">Struts Core API</a></li> + <li><a href="/docs/plugins.html">Plugin APIs</a></li> + <li><a href="/docs/tag-reference.html">Tag reference</a></li> + <li><a href="http://cwiki.apache.org/S2PLUGINS/home.html">Plugin registry</a></li> + <li class="divider"></li> + <li><a href="/docs/tutorials.html">Tutorials - DEPRECATED</a></li> + <li><a href="/docs/faqs.html">FAQs - DEPRECATED</a></li> + <li><a href="/docs/guides.html">Guides - DEPRECATED</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Contributing<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/youatstruts.html">You at Struts</a></li> + <li><a href="/helping.html">How to Help FAQ</a></li> + <li><a href="/dev-mail.html">Development Lists</a></li> + <li class="divider"></li> + <li><a href="/submitting-patches.html">Submitting patches</a></li> + <li><a href="/builds.html">Source Code</a></li> + <li><a href="/coding-standards.html">Coding standards</a></li> + <li class="divider"></li> + <li><a href="/releases.html">Release Guidelines</a></li> + <li><a href="/bylaws.html">PMC Charter</a></li> + <li><a href="/volunteers.html">Volunteers</a></li> + <li><a href="https://git-wip-us.apache.org/repos/asf?p=struts.git">Source Repository</a></li> + </ul> + </li> + <li class="apache"><a href="http://www.apache.org/"><img src="/img/apache.png"></a></li> + </ul> + </div> + </div> + </div> + </nav> +</header> + + +<article class="container"> + <section class="col-md-12"> + <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/elseif-tag.md" title="Edit this page on GitHub">Edit on GitHub</a> + <h1 id="elseif">elseif</h1> + +<p>Please make sure you have read the <a href="#PAGE_13927">Tag Syntax</a> document and understand how tag attribute syntax works.</p> + +<table> + <tbody> + <tr> + </tr> + </tbody> +</table> + +<p><strong>Description</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=javadoc|javadoc=true|url=org.apache.struts2.components.ElseIf</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<p><strong>Parameters</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=tagattributes|javadoc=false|url=struts2-tags/elseif.html</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<p><strong>Examples</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=example|lang=xml|javadoc=true|url=org.apache.struts2.components.ElseIf</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + + </section> +</article> + + +<footer class="container"> + <div class="col-md-12"> + Copyright © 2000-2016 <a href="http://www.apache.org/">The Apache Software Foundation </a>. + All Rights Reserved. + </div> + <div class="col-md-12"> + Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project logos are + trademarks of The Apache Software Foundation. + </div> + <div class="col-md-12">Logo and website design donated by <a href="https://softwaremill.com/">SoftwareMill</a>.</div> +</footer> + +<script>!function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (!d.getElementById(id)) { + js = d.createElement(s); + js.id = id; + js.src = "//platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } +}(document, "script", "twitter-wjs");</script> +<script src="https://apis.google.com/js/platform.js" async="async" defer="defer"></script> + +<div id="fb-root"></div> + +<script>(function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); + js.id = id; + js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; + fjs.parentNode.insertBefore(js, fjs); +}(document, 'script', 'facebook-jssdk'));</script> + + +<script> +$(function() { + return $("h2, h3, h4, h5, h6").each(function(i, el) { + var $el, id; + $el = $(el); + id = $el.attr('id'); + if (id) { + $el.removeAttr('id'); + return $el.before($("<a />").addClass('anchor').attr('name', id)); + } + }); +}); +</script> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/struts-site/blob/2b2ec9b3/content/tag-developers/extending-themes.html ---------------------------------------------------------------------- diff --git a/content/tag-developers/extending-themes.html b/content/tag-developers/extending-themes.html new file mode 100644 index 0000000..7a807eb --- /dev/null +++ b/content/tag-developers/extending-themes.html @@ -0,0 +1,335 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="Date-Revision-yyyymmdd" content="20140918"/> + <meta http-equiv="Content-Language" content="en"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + + <title>Tag Developers Guide (WIP)</title> + + <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic" rel="stylesheet" type="text/css"> + <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> + <link href="/css/main.css" rel="stylesheet"> + <link href="/css/custom.css" rel="stylesheet"> + <link href="/highlighter/github-theme.css" rel="stylesheet"> + + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script type="text/javascript" src="/bootstrap/js/bootstrap.js"></script> + <script type="text/javascript" src="/js/community.js"></script> +</head> +<body> + +<a href="http://github.com/apache/struts" class="github-ribbon"> + <img style="position: absolute; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"> +</a> + +<header> + <nav> + <div role="navigation" class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" data-toggle="collapse" data-target="#struts-menu" class="navbar-toggle"> + Menu + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a href="/index.html" class="navbar-brand logo"><img src="/img/struts-logo.svg"></a> + </div> + <div id="struts-menu" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Home<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/index.html">Welcome</a></li> + <li><a href="/downloads.html">Downloads</a></li> + <li><a href="/announce.html">Announcements</a></li> + <li><a href="http://www.apache.org/licenses/">License</a></li> + <li><a href="http://apache.org/foundation/thanks.html">Thanks!</a></li> + <li><a href="http://apache.org/foundation/sponsorship.html">Sponsorship</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Support<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/mail.html">User Mailing List</a></li> + <li><a href="https://issues.apache.org/jira/browse/WW">Issue Tracker</a></li> + <li><a href="/security.html">Reporting Security Issues</a></li> + <li class="divider"></li> + <li><a href="/maven/project-info.html">Project info</a></li> + <li><a href="/maven/struts2-core/dependencies.html">Struts Core dependencies</a></li> + <li><a href="/maven/struts2-plugins/modules.html">Plugin dependencies</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Documentation<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/birdseye.html">Birds Eye</a></li> + <li><a href="/primer.html">Key Technologies</a></li> + <li><a href="/kickstart.html">Kickstart FAQ</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/WW/Home">Wiki</a></li> + <li class="divider"></li> + <li><a href="/getting-started/">Getting Started</a></li> + <li><a href="/security/">Security Guide</a></li> + <li><a href="/core-developers/">Core Developers Guide</a></li> + <li><a href="/tag-developers/">Tag Developers Guide</a></li> + <li><a href="/maven-archetypes/">Maven Archetypes</a></li> + <li><a href="/plugins/">Plugins</a></li> + <li class="divider"></li> + <li><a href="/maven/struts2-core/apidocs/index.html">Struts Core API</a></li> + <li><a href="/docs/plugins.html">Plugin APIs</a></li> + <li><a href="/docs/tag-reference.html">Tag reference</a></li> + <li><a href="http://cwiki.apache.org/S2PLUGINS/home.html">Plugin registry</a></li> + <li class="divider"></li> + <li><a href="/docs/tutorials.html">Tutorials - DEPRECATED</a></li> + <li><a href="/docs/faqs.html">FAQs - DEPRECATED</a></li> + <li><a href="/docs/guides.html">Guides - DEPRECATED</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Contributing<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/youatstruts.html">You at Struts</a></li> + <li><a href="/helping.html">How to Help FAQ</a></li> + <li><a href="/dev-mail.html">Development Lists</a></li> + <li class="divider"></li> + <li><a href="/submitting-patches.html">Submitting patches</a></li> + <li><a href="/builds.html">Source Code</a></li> + <li><a href="/coding-standards.html">Coding standards</a></li> + <li class="divider"></li> + <li><a href="/releases.html">Release Guidelines</a></li> + <li><a href="/bylaws.html">PMC Charter</a></li> + <li><a href="/volunteers.html">Volunteers</a></li> + <li><a href="https://git-wip-us.apache.org/repos/asf?p=struts.git">Source Repository</a></li> + </ul> + </li> + <li class="apache"><a href="http://www.apache.org/"><img src="/img/apache.png"></a></li> + </ul> + </div> + </div> + </div> + </nav> +</header> + + +<article class="container"> + <section class="col-md-12"> + <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/extending-themes.md" title="Edit this page on GitHub">Edit on GitHub</a> + <h1 id="extending-themes">Extending Themes</h1> + +<p>Most often, an application may just need to override a template (see <a href="#PAGE_13817">Template Loading</a>) so that a certain control renders differently. Or, an application may need to add a new template to an existing theme. Other times, you might want to create an entirely new theme, perhaps because you are building a rich set of unique and reusable templates for your organization.</p> + +<p>There are three ways to create new themes:</p> + +<ul> + <li> + <p>Create a new theme from scratch (<strong>hard!</strong>)</p> + </li> + <li> + <p>Wrap an existing theme</p> + </li> + <li> + <p>Extend an existing theme</p> + </li> +</ul> + +<p><strong>Creating a New Theme from Scratch</strong></p> + +<p>Itâs probably never a good idea to create a new theme from scratch. Instead, use the <a href="#PAGE_14291">simple theme</a> as a starting point. The simple theme provides just enough foundation to make it easy to create new controls by extending or wrapping the basic controls. Before starting a new theme, be sure to review the source templates for all of the provided themes. The existing themes are your best guide to creating new themes.</p> + +<table> + <tbody> + <tr> + </tr> + </tbody> +</table> + +<p><strong>Wrapping an Existing Theme</strong></p> + +<p>The <a href="#PAGE_13834">xhtml theme</a> provides several good examples of the âwrappingâ technique. The <a href="#PAGE_14291">simple theme</a> renders the basic control. The xhtml theme âdresses upâ many of the controls by adding a header and footer.</p> + +<p><strong>Wrapping a control</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><#include "/${parameters.templateDir}/${parameters.expandTheme}/controlheader.ftl" /> +<#include "/${parameters.templateDir}/simple/xxx.ftl" /> +<#include "/${parameters.templateDir}/${parameters.expandTheme}/controlfooter.ftl" /> + +</code></pre> +</div> + +<p>Wrapping is a great way to augment the basic HTML elements provided by the simple theme.</p> + +<p><strong>Extending an Existing Theme</strong></p> + +<p>One benefit of object-orientated programming is that it lets us âdesign by difference.â We can extend an object and code only the behaviour that changes. Themes provide a similar capability. The subdirectory that hosts a theme can contain a</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>theme.properties +</code></pre> +</div> +<p>file. A</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>parent +</code></pre> +</div> +<p>entry can be added to the property file to designate a theme to extend. The <a href="#PAGE_14205">ajax theme</a> extends the <a href="#PAGE_13834">xhtml theme</a> using this technique.</p> + +<p><strong>/template/ajax/theme.properties</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code>parent = xhtml + +</code></pre> +</div> + +<p>An extended theme does not need to implement every single template that the <a href="#PAGE_14248">Struts Tags</a> expect. It only needs to implement the templates that change. The other templates are loaded from the parent template.</p> + +<p><strong>Special parameters</strong></p> + +<p><a href="http://struts.apache.org/development/2.x/struts2-core/apidocs/org/apache/struts2/components/UIBean.html">UIBean</a>^[http://struts.apache.org/development/2.x/struts2-core/apidocs/org/apache/struts2/components/UIBean.html] provides few special parameters which can be used to build a new template (they are already used in</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>xhtml +</code></pre> +</div> +<p>and</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>css_xhtml +</code></pre> +</div> +<p>theme):</p> + +<ul> + <li></li> +</ul> + +<div class="highlighter-rouge"><pre class="highlight"><code>templateDir +</code></pre> +</div> +<ul> + <li> + <p>current value of templateDir parameter, see <a href="#PAGE_14227">Selecting Template Directory</a></p> + </li> + <li></li> +</ul> + +<div class="highlighter-rouge"><pre class="highlight"><code>theme +</code></pre> +</div> +<ul> + <li> + <p>used theme, see <a href="#PAGE_14016">Selecting Themes</a></p> + </li> + <li></li> +</ul> + +<div class="highlighter-rouge"><pre class="highlight"><code>template +</code></pre> +</div> +<ul> + <li> + <p>name of the template file to use (i.e. text)</p> + </li> + <li></li> +</ul> + +<div class="highlighter-rouge"><pre class="highlight"><code>themeExpansionToken +</code></pre> +</div> +<ul> + <li>special token used to indicate to search for a template also in parent theme (when used with</li> +</ul> + +<div class="highlighter-rouge"><pre class="highlight"><code><#include /> +</code></pre> +</div> +<p>directive)</p> + +<ul> + <li></li> +</ul> + +<div class="highlighter-rouge"><pre class="highlight"><code>expandTheme +</code></pre> +</div> +<ul> + <li>tells internal template loader mechanism to try load template from current theme and then from parent theme (and parent theme, and so on)</li> +</ul> + +<p>Using</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>expandTheme +</code></pre> +</div> +<p>parameter allows to override only some parts of the themeâs templates, e.g. css.ftl. You can define a new theme (set theme.properties) and override just single file.</p> + +<p>${parameters.expandTheme} is a recurrence which tells ThemeManager to load template from current theme and then from parent theme (defined in theme.properties) and so on.</p> + +<p>Please also notice that the ThemeManager builds list of possible templates based on current theme and inherited themes (/template/custom/textarea.ftl, /template/xhtml/textarea.ftl, /template/simple/textarea.ftl). This is also true for templates which are loaded via ${parameters.expandTheme}.</p> + +<p>(ok) See also example <em>Struts 2 Themes</em> or <a href="http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme">Creating a Theme in Struts 2</a>^[http://www.vitarara.org/cms/struts_2_cookbook/creating_a_theme] (Mark Menard)</p> + + + </section> +</article> + + +<footer class="container"> + <div class="col-md-12"> + Copyright © 2000-2016 <a href="http://www.apache.org/">The Apache Software Foundation </a>. + All Rights Reserved. + </div> + <div class="col-md-12"> + Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project logos are + trademarks of The Apache Software Foundation. + </div> + <div class="col-md-12">Logo and website design donated by <a href="https://softwaremill.com/">SoftwareMill</a>.</div> +</footer> + +<script>!function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (!d.getElementById(id)) { + js = d.createElement(s); + js.id = id; + js.src = "//platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } +}(document, "script", "twitter-wjs");</script> +<script src="https://apis.google.com/js/platform.js" async="async" defer="defer"></script> + +<div id="fb-root"></div> + +<script>(function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); + js.id = id; + js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; + fjs.parentNode.insertBefore(js, fjs); +}(document, 'script', 'facebook-jssdk'));</script> + + +<script> +$(function() { + return $("h2, h3, h4, h5, h6").each(function(i, el) { + var $el, id; + $el = $(el); + id = $el.attr('id'); + if (id) { + $el.removeAttr('id'); + return $el.before($("<a />").addClass('anchor').attr('name', id)); + } + }); +}); +</script> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/struts-site/blob/2b2ec9b3/content/tag-developers/form-tags.html ---------------------------------------------------------------------- diff --git a/content/tag-developers/form-tags.html b/content/tag-developers/form-tags.html new file mode 100644 index 0000000..171d1d7 --- /dev/null +++ b/content/tag-developers/form-tags.html @@ -0,0 +1,481 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="Date-Revision-yyyymmdd" content="20140918"/> + <meta http-equiv="Content-Language" content="en"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + + <title>Tag Developers Guide (WIP)</title> + + <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic" rel="stylesheet" type="text/css"> + <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> + <link href="/css/main.css" rel="stylesheet"> + <link href="/css/custom.css" rel="stylesheet"> + <link href="/highlighter/github-theme.css" rel="stylesheet"> + + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script type="text/javascript" src="/bootstrap/js/bootstrap.js"></script> + <script type="text/javascript" src="/js/community.js"></script> +</head> +<body> + +<a href="http://github.com/apache/struts" class="github-ribbon"> + <img style="position: absolute; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"> +</a> + +<header> + <nav> + <div role="navigation" class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" data-toggle="collapse" data-target="#struts-menu" class="navbar-toggle"> + Menu + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a href="/index.html" class="navbar-brand logo"><img src="/img/struts-logo.svg"></a> + </div> + <div id="struts-menu" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Home<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/index.html">Welcome</a></li> + <li><a href="/downloads.html">Downloads</a></li> + <li><a href="/announce.html">Announcements</a></li> + <li><a href="http://www.apache.org/licenses/">License</a></li> + <li><a href="http://apache.org/foundation/thanks.html">Thanks!</a></li> + <li><a href="http://apache.org/foundation/sponsorship.html">Sponsorship</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Support<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/mail.html">User Mailing List</a></li> + <li><a href="https://issues.apache.org/jira/browse/WW">Issue Tracker</a></li> + <li><a href="/security.html">Reporting Security Issues</a></li> + <li class="divider"></li> + <li><a href="/maven/project-info.html">Project info</a></li> + <li><a href="/maven/struts2-core/dependencies.html">Struts Core dependencies</a></li> + <li><a href="/maven/struts2-plugins/modules.html">Plugin dependencies</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Documentation<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/birdseye.html">Birds Eye</a></li> + <li><a href="/primer.html">Key Technologies</a></li> + <li><a href="/kickstart.html">Kickstart FAQ</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/WW/Home">Wiki</a></li> + <li class="divider"></li> + <li><a href="/getting-started/">Getting Started</a></li> + <li><a href="/security/">Security Guide</a></li> + <li><a href="/core-developers/">Core Developers Guide</a></li> + <li><a href="/tag-developers/">Tag Developers Guide</a></li> + <li><a href="/maven-archetypes/">Maven Archetypes</a></li> + <li><a href="/plugins/">Plugins</a></li> + <li class="divider"></li> + <li><a href="/maven/struts2-core/apidocs/index.html">Struts Core API</a></li> + <li><a href="/docs/plugins.html">Plugin APIs</a></li> + <li><a href="/docs/tag-reference.html">Tag reference</a></li> + <li><a href="http://cwiki.apache.org/S2PLUGINS/home.html">Plugin registry</a></li> + <li class="divider"></li> + <li><a href="/docs/tutorials.html">Tutorials - DEPRECATED</a></li> + <li><a href="/docs/faqs.html">FAQs - DEPRECATED</a></li> + <li><a href="/docs/guides.html">Guides - DEPRECATED</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Contributing<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/youatstruts.html">You at Struts</a></li> + <li><a href="/helping.html">How to Help FAQ</a></li> + <li><a href="/dev-mail.html">Development Lists</a></li> + <li class="divider"></li> + <li><a href="/submitting-patches.html">Submitting patches</a></li> + <li><a href="/builds.html">Source Code</a></li> + <li><a href="/coding-standards.html">Coding standards</a></li> + <li class="divider"></li> + <li><a href="/releases.html">Release Guidelines</a></li> + <li><a href="/bylaws.html">PMC Charter</a></li> + <li><a href="/volunteers.html">Volunteers</a></li> + <li><a href="https://git-wip-us.apache.org/repos/asf?p=struts.git">Source Repository</a></li> + </ul> + </li> + <li class="apache"><a href="http://www.apache.org/"><img src="/img/apache.png"></a></li> + </ul> + </div> + </div> + </div> + </nav> +</header> + + +<article class="container"> + <section class="col-md-12"> + <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/form-tags.md" title="Edit this page on GitHub">Edit on GitHub</a> + <h1 id="form-tags">Form Tags</h1> + +<p>Please make sure you have read the <a href="#PAGE_13927">Tag Syntax</a> document and understand how tag attribute syntax works.</p> + +<table> + <tbody> + <tr> + </tr> + </tbody> +</table> + +<p>Within the form tags, there are two classes of tags: the form tag itself, and all other tags, which make up the individual form elements. The behavior of the form tag is different than the elements enclosed within it.</p> + +<p><strong>Form Tag Themes</strong></p> + +<p>As explained in <a href="#PAGE_14247">Themes and Templates</a>, the HTML Tags (which includes Form Tags) are all driven by templates. Templates are grouped together to create themes. The framework bundles three themes in the distribution.</p> + +<table> + <thead> + <tr> + <th>simple</th> + <th>Sometimes <em>too</em> simple</th> + <th> </th> + </tr> + </thead> + <tbody> + <tr> + <td>xhtml</td> + <td>Extends simple</td> + <td>(default)</td> + </tr> + <tr> + <td>ajax</td> + <td>Extends xhtml</td> + <td> </td> + </tr> + </tbody> +</table> + +<p>The predefined themes can be used âas isâ or customized.</p> + +<table> + <tbody> + <tr> + <td>The xhtml theme renders out a two-column table. If a different layout is needed, do <em>not</em> write your own HTML. Create a new theme or utilize the simple theme.</td> + </tr> + </tbody> +</table> + +<table> + <tbody> + <tr> + </tr> + </tbody> +</table> + +<p><strong>Simple theme caveats</strong></p> + +<p>The downside of using the simple theme is that it doesnât support as many of the attributes that the other themes do. For example, the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>label +</code></pre> +</div> +<p>attribute does nothing in the simple theme, and the automatic display of error messages is not supported.</p> + +<p><strong>Common Attributes</strong></p> + +<p>All the form tags extend the UIBean class. This base class provides a set of common attributes, that can be grouped in to three categories:</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>templated-related +</code></pre> +</div> +<p>, javascript-related, and general attributes. The individual attributes are documented on each tagâs reference page.</p> + +<p>In addition to the common attributes, a special attribute exists for all form element tags:</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>form +</code></pre> +</div> +<p>(${parameters.form}). The</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>form +</code></pre> +</div> +<p>property represents the attributes used to render the form tag, such as the formâs id. In a template, the formâs ID can be found by calling ${parameters.form.id}.</p> + +<p><strong>Template-Related Attributes</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=templateRelatedAttributes|javadoc=true|url=org.apache.struts2.components.UIBean</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<p><strong>Javascript-Related Attributes</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=javascriptRelatedAttributes|javadoc=true|url=org.apache.struts2.components.UIBean</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<p><strong>Tooltip Related Attributes</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=tooltipattributes|javadoc=true|url=org.apache.struts2.components.UIBean</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<p><strong>General Attributes</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=generalAttributes|javadoc=true|url=org.apache.struts2.components.UIBean</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<table> + <tbody> + <tr> + <td>Some tag attributes may not be utilized by all, or any, of the templates. For example, the form tag supports the tabindex attribute, but none of the themes render the tabindex.</td> + </tr> + </tbody> +</table> + +<table> + <tbody> + <tr> + </tr> + </tbody> +</table> + +<p><strong>Value/Name Relationship</strong></p> + +<p>In many of the tags (except for the form tag) there is a unique relationship between the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>name +</code></pre> +</div> +<p>and</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>value +</code></pre> +</div> +<p>attributes. The</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>name +</code></pre> +</div> +<p>attribute provides the name for the tag, which in turn is used as the control attribute when the form is submitted. The value submitted is bound to the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>name +</code></pre> +</div> +<p>. In most cases, the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>name +</code></pre> +</div> +<p>maps to a simple JavaBean property, such as âpostalCodeâ. On a submit, the value would be set to the property by calling the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>setPostalCode +</code></pre> +</div> +<p>mutator.</p> + +<p>Likewise, a form control could be populated by calling a JavaBean accessor, like</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>getPostalCode +</code></pre> +</div> +<p>. In the expression language, we can refer to the JavaBean property by name. An expression like â%{postalCode}â would in turn call</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>getPostalCode +</code></pre> +</div> +<p>.</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><@s.form action="updateAddress"> + <@s.textfield label="Postal Code" name="postalCode" value="%{postalCode}"/> + ... +</@s.form> + +</code></pre> +</div> + +<p>However, since the tags imply a relationship between the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>name +</code></pre> +</div> +<p>and</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>value +</code></pre> +</div> +<p>, the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>value +</code></pre> +</div> +<p>attribute is optional. If a</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>value +</code></pre> +</div> +<p>is not specified, by default, the JavaBean accessor is used instead.</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><@s.form action="updateAddress"> + <@s.textfield label="Postal Code" name="postalCode"/> + ... +</@s.form> + +</code></pre> +</div> + +<p>While most attributes are exposed to the underlying templates as the same key as the attribute (${parameters.label}), the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>value +</code></pre> +</div> +<p>attribute is not. Instead, it can be accessed via the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>nameValue +</code></pre> +</div> +<p>key (${parameters.nameValue}). The</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>nameValue +</code></pre> +</div> +<p>key indicates that the value may have been generated from the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>name +</code></pre> +</div> +<p>attribute rather than explicitly defined in the</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>value +</code></pre> +</div> +<p>attribute.</p> + +<p><strong>ID Name Assignment</strong></p> + +<p>All form tags automatically assign an ID to the control, but the ID can be overridden if needed.</p> + +<table> + <thead> + <tr> + <th>Forms</th> + <th>The default ID is the action name. For example, âupdateAddressâ.</th> + </tr> + </thead> + <tbody> + <tr> + <td>Controls</td> + <td>The default ID is the formâs name concatenated with the tag name. For example, âupdateAddress_postalCodeâ.</td> + </tr> + </tbody> +</table> + +<p><strong>Form labelposition propagation</strong></p> + +<p>When </p> + +<div class="highlighter-rouge"><pre class="highlight"><code>labelposition +</code></pre> +</div> +<p>attribute was defined for </p> + +<div class="highlighter-rouge"><pre class="highlight"><code><s:form> +</code></pre> +</div> +<p>tag it will be propagated to all form elements, but if form element defines its own </p> + +<div class="highlighter-rouge"><pre class="highlight"><code>labelposition +</code></pre> +</div> +<p>it will take precedence over </p> + +<div class="highlighter-rouge"><pre class="highlight"><code><s:form> +</code></pre> +</div> +<p>âs attribute. Since 2.3.17.</p> + +<p><strong>Required Attribute</strong></p> + +<p>The</p> + +<div class="highlighter-rouge"><pre class="highlight"><code>required +</code></pre> +</div> +<p>attribute on many UI tags defaults to true only if you have client-side validation enabled, and a validator is associated with that particular field.</p> + +<p><strong>Tooltip</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=tooltipdescription|javadoc=true|url=org.apache.struts2.components.UIBean</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="err">snippet:id=tooltipexample|lang=xml|javadoc=true|url=org.apache.struts2.components.UIBean</span><span class="p">}</span><span class="w"> +</span></code></pre> +</div> + + </section> +</article> + + +<footer class="container"> + <div class="col-md-12"> + Copyright © 2000-2016 <a href="http://www.apache.org/">The Apache Software Foundation </a>. + All Rights Reserved. + </div> + <div class="col-md-12"> + Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project logos are + trademarks of The Apache Software Foundation. + </div> + <div class="col-md-12">Logo and website design donated by <a href="https://softwaremill.com/">SoftwareMill</a>.</div> +</footer> + +<script>!function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (!d.getElementById(id)) { + js = d.createElement(s); + js.id = id; + js.src = "//platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } +}(document, "script", "twitter-wjs");</script> +<script src="https://apis.google.com/js/platform.js" async="async" defer="defer"></script> + +<div id="fb-root"></div> + +<script>(function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); + js.id = id; + js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; + fjs.parentNode.insertBefore(js, fjs); +}(document, 'script', 'facebook-jssdk'));</script> + + +<script> +$(function() { + return $("h2, h3, h4, h5, h6").each(function(i, el) { + var $el, id; + $el = $(el); + id = $el.attr('id'); + if (id) { + $el.removeAttr('id'); + return $el.before($("<a />").addClass('anchor').attr('name', id)); + } + }); +}); +</script> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/struts-site/blob/2b2ec9b3/content/tag-developers/freemarker-tags.html ---------------------------------------------------------------------- diff --git a/content/tag-developers/freemarker-tags.html b/content/tag-developers/freemarker-tags.html new file mode 100644 index 0000000..6d4e1da --- /dev/null +++ b/content/tag-developers/freemarker-tags.html @@ -0,0 +1,331 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="Date-Revision-yyyymmdd" content="20140918"/> + <meta http-equiv="Content-Language" content="en"/> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + + <title>Tag Developers Guide (WIP)</title> + + <link href="//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,400italic,600italic,700italic" rel="stylesheet" type="text/css"> + <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> + <link href="/css/main.css" rel="stylesheet"> + <link href="/css/custom.css" rel="stylesheet"> + <link href="/highlighter/github-theme.css" rel="stylesheet"> + + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script type="text/javascript" src="/bootstrap/js/bootstrap.js"></script> + <script type="text/javascript" src="/js/community.js"></script> +</head> +<body> + +<a href="http://github.com/apache/struts" class="github-ribbon"> + <img style="position: absolute; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"> +</a> + +<header> + <nav> + <div role="navigation" class="navbar navbar-default navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" data-toggle="collapse" data-target="#struts-menu" class="navbar-toggle"> + Menu + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a href="/index.html" class="navbar-brand logo"><img src="/img/struts-logo.svg"></a> + </div> + <div id="struts-menu" class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Home<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/index.html">Welcome</a></li> + <li><a href="/downloads.html">Downloads</a></li> + <li><a href="/announce.html">Announcements</a></li> + <li><a href="http://www.apache.org/licenses/">License</a></li> + <li><a href="http://apache.org/foundation/thanks.html">Thanks!</a></li> + <li><a href="http://apache.org/foundation/sponsorship.html">Sponsorship</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Support<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/mail.html">User Mailing List</a></li> + <li><a href="https://issues.apache.org/jira/browse/WW">Issue Tracker</a></li> + <li><a href="/security.html">Reporting Security Issues</a></li> + <li class="divider"></li> + <li><a href="/maven/project-info.html">Project info</a></li> + <li><a href="/maven/struts2-core/dependencies.html">Struts Core dependencies</a></li> + <li><a href="/maven/struts2-plugins/modules.html">Plugin dependencies</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Documentation<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/birdseye.html">Birds Eye</a></li> + <li><a href="/primer.html">Key Technologies</a></li> + <li><a href="/kickstart.html">Kickstart FAQ</a></li> + <li><a href="https://cwiki.apache.org/confluence/display/WW/Home">Wiki</a></li> + <li class="divider"></li> + <li><a href="/getting-started/">Getting Started</a></li> + <li><a href="/security/">Security Guide</a></li> + <li><a href="/core-developers/">Core Developers Guide</a></li> + <li><a href="/tag-developers/">Tag Developers Guide</a></li> + <li><a href="/maven-archetypes/">Maven Archetypes</a></li> + <li><a href="/plugins/">Plugins</a></li> + <li class="divider"></li> + <li><a href="/maven/struts2-core/apidocs/index.html">Struts Core API</a></li> + <li><a href="/docs/plugins.html">Plugin APIs</a></li> + <li><a href="/docs/tag-reference.html">Tag reference</a></li> + <li><a href="http://cwiki.apache.org/S2PLUGINS/home.html">Plugin registry</a></li> + <li class="divider"></li> + <li><a href="/docs/tutorials.html">Tutorials - DEPRECATED</a></li> + <li><a href="/docs/faqs.html">FAQs - DEPRECATED</a></li> + <li><a href="/docs/guides.html">Guides - DEPRECATED</a></li> + </ul> + </li> + <li class="dropdown"> + <a data-toggle="dropdown" href="#" class="dropdown-toggle"> + Contributing<b class="caret"></b> + </a> + <ul class="dropdown-menu"> + <li><a href="/youatstruts.html">You at Struts</a></li> + <li><a href="/helping.html">How to Help FAQ</a></li> + <li><a href="/dev-mail.html">Development Lists</a></li> + <li class="divider"></li> + <li><a href="/submitting-patches.html">Submitting patches</a></li> + <li><a href="/builds.html">Source Code</a></li> + <li><a href="/coding-standards.html">Coding standards</a></li> + <li class="divider"></li> + <li><a href="/releases.html">Release Guidelines</a></li> + <li><a href="/bylaws.html">PMC Charter</a></li> + <li><a href="/volunteers.html">Volunteers</a></li> + <li><a href="https://git-wip-us.apache.org/repos/asf?p=struts.git">Source Repository</a></li> + </ul> + </li> + <li class="apache"><a href="http://www.apache.org/"><img src="/img/apache.png"></a></li> + </ul> + </div> + </div> + </div> + </nav> +</header> + + +<article class="container"> + <section class="col-md-12"> + <a class="edit-on-gh" href="https://github.com/apache/struts-site/edit/master/source/tag-developers/freemarker-tags.md" title="Edit this page on GitHub">Edit on GitHub</a> + <h1 class="no_toc" id="freemarker-tags">FreeMarker Tags</h1> + +<ul id="markdown-toc"> + <li><a href="#attributes-and-parameters" id="markdown-toc-attributes-and-parameters">Attributes and Parameters</a> <ul> + <li><a href="#using-inline-attributes-with-templates" id="markdown-toc-using-inline-attributes-with-templates">Using inline attributes with templates</a></li> + </ul> + </li> + <li><a href="#attribute-types" id="markdown-toc-attribute-types">Attribute Types</a></li> + <li><a href="#jsp-tag-support" id="markdown-toc-jsp-tag-support">JSP Tag Support</a></li> +</ul> + +<p>FreeMarker tags are extensions of the generic <a href="struts-tags.html">Struts Tags</a> provided by the framework. You can jump +right in just by knowing the generic structure in which the tags can be accessed:</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>@s.tag> ...<span class="err"><</span>/@s.tag> +</code></pre> +</div> + +<p>, where <code class="highlighter-rouge">tag</code> is any of the <a href="tags.html">tags</a> supported by the framework.</p> + +<p>For example, in JSP you might create a form using Struts tags.</p> + +<p><strong>JSP Form</strong></p> + +<pre><code class="language-jsp"><s:form action="updatePerson"> + <s:textfield label="First name" name="firstName"/> + <s:submit value="Update"/> +</s:form> +</code></pre> + +<p>In FreeMarker the same form can also be built using Struts tags.</p> + +<p><strong>FTL Form</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>@s.form action="updatePerson"> + <span class="err"><</span>@s.textfield label="First name" name="firstName"/> + <span class="err"><</span>@s.submit value="Update"/> +<span class="err"><</span>/@s.form> +</code></pre> +</div> + +<p><strong>But, wait thereâs more!</strong></p> + +<p>Aside from doing everything that the JSP tags do, the FTL tags boast additional features that you can use to make your +pages even easier to code. You can even invoke third-party JSP taglibs as if there were native FTL tags.</p> + +<h2 id="attributes-and-parameters">Attributes and Parameters</h2> + +<p>Unlike older versions of JSP (in which the <a href="jsp-tags.html">JSP Tags</a> are based), FreeMarker allows for <em>dynamic attributes</em>, +much like JSP 2.0. You can supply attributes to the tags that the tag doesnât explicitedly support. Those attributes +that cannot be applied directly to the tag object will be set to the tagâs general-purpose <code class="highlighter-rouge">parameters</code> Map.</p> + +<p>Suppose we wanted to build an URL in a JSP. The URL needs to take an arbitary parameter to the query string, +that (being arbitary) isnât specified on the URL tag. In a JSP, weâd have to use the <code class="highlighter-rouge">url</code> and <code class="highlighter-rouge">param</code> tags together.</p> + +<p><strong>Creating a URL with a query string (JSP)</strong></p> + +<pre><code class="language-jsp"><s:url value="somePage"> + <s:param name="personId" value="%{personId}"/> +</s:url> +</code></pre> + +<p>In FreeMarker, we can pass the arbitrary parameter directly and create the URL in one simple statement.</p> + +<p><strong>Creating a URL with a query string (FTL)</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>@s.url value="somePage" personId="${personId}"/> +</code></pre> +</div> + +<h3 id="using-inline-attributes-with-templates">Using inline attributes with templates</h3> + +<p>Suppose you created a âthree columnâ theme to replace the typical two column theme (xhtml). You might want an additional +parameter to display in the third column called âdescriptionâ. Using FreeMarker, you can just pop the description +attribute into the textfield tag, no fuss, no muss.</p> + +<p><strong>Passing an attribute to the template</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>@s.form action="updatePerson"> + <span class="err"><</span>@s.textfield label="First name" name="firstName" description="..."/> + <span class="err"><</span>@s.submit value="Update"/> +<span class="err"><</span>/@s.form> +</code></pre> +</div> + +<p>In the new template, the description is referenced via the parameters Map: <code class="highlighter-rouge">${parameters.description}</code>.</p> + +<blockquote> + <p>For simple cases, inline attributes are much easier to use than the param} tag. But, the <code class="highlighter-rouge">param</code> tag is more flexible +than inline attributes for advanced use cases. For example, <code class="highlighter-rouge">param</code> can take the entire body of the tag and apply +that as the <code class="highlighter-rouge">value</code> attribute.</p> +</blockquote> + +<h2 id="attribute-types">Attribute Types</h2> + +<p>Remember that all tag attributes must first be set as Strings - they are then later evaluated (using <a href="ognl.html">OGNL</a>) +to a different type, such as List, int, or boolean. This generally works just fine, but it can be limiting when using +FreeMarker which provides more advanced ways to apply attributes. Suppose the following example:</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>@s.select label="Foo label - ${foo}" name="${name}" list="%1"/> +</code></pre> +</div> + +<p>What will happen here is that each attribute will be evaluated to a String as best it can. This may involve calling the +<code class="highlighter-rouge">toString</code> method on the internal FreeMarker objects. In this case, all objects will end up being exactly what you would +expect. Then, when the tag runs, the <code class="highlighter-rouge">list</code> attribute will be converted from a String to a List using <a href="ogn.html">OGNL</a>âs +advanced collection support.</p> + +<p>But suppose you wish to use FreeMarkerâs list or hash support instead? You can do this:</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>@s.select label="Foo label - ${foo}" name="${name}" list=[1, 2, 3]/> +</code></pre> +</div> + +<p>Notice that the list attribute no longer has quotes around it. Now it will come in to the tag as an object that canât +easily be converted to a String. Normally, the tag would just call <code class="highlighter-rouge">toString</code>, which would return <code class="highlighter-rouge">[1, 2, 3]</code> and be +unable to be converted back to a List by OGNL. Rather than go through all this back and forth, the frameworksâs FreeMarker +tag support will recognize collections and not pass them through the normal tag attribute. Instead, the framework will +set them directly in the <code class="highlighter-rouge">parameters</code> Map, ready to be consumed by the template.</p> + +<p>In the end, everything tends to do what you would expect, but it can help to understand the difference of when OGNL is +being used and when it isnât, and how attribute types get converted.</p> + +<h2 id="jsp-tag-support">JSP Tag Support</h2> + +<p>While the framework provides native FreeMarker Tags, you might wish to use other third-party tags that are only available +for JSP. Fortunately, FreeMarker has the ability to run JSP tags. To do so, you must include the JspSupportServlet in +the applicationâs <code class="highlighter-rouge">web.xml</code>, as this allows the FreeMarker integration to get access to the required objects needed +to emulate a JSP taglib container.</p> + +<p><strong>Adding JspSupportSerlvet to web.xml</strong></p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="nt"><servlet></span> + <span class="nt"><servlet-name></span>JspSupportServlet<span class="nt"></servlet-name></span> + <span class="nt"><servlet-class></span>org.apache.struts2.views.JspSupportServlet<span class="nt"></servlet-class></span> + <span class="nt"><load-on-startup></span>1<span class="nt"></load-on-startup></span> +<span class="nt"></servlet></span> +</code></pre> +</div> + +<p>Once youâve done that, you can simply add something like this in your templates:</p> + +<div class="highlighter-rouge"><pre class="highlight"><code><span class="err"><</span>#assign cewolf=JspTaglibs["/WEB-INF/cewolf.tld"] /> +... +<span class="err"><</span>@cewold.xxx ... /> +</code></pre> +</div> + + </section> +</article> + + +<footer class="container"> + <div class="col-md-12"> + Copyright © 2000-2016 <a href="http://www.apache.org/">The Apache Software Foundation </a>. + All Rights Reserved. + </div> + <div class="col-md-12"> + Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts project logos are + trademarks of The Apache Software Foundation. + </div> + <div class="col-md-12">Logo and website design donated by <a href="https://softwaremill.com/">SoftwareMill</a>.</div> +</footer> + +<script>!function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (!d.getElementById(id)) { + js = d.createElement(s); + js.id = id; + js.src = "//platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } +}(document, "script", "twitter-wjs");</script> +<script src="https://apis.google.com/js/platform.js" async="async" defer="defer"></script> + +<div id="fb-root"></div> + +<script>(function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) return; + js = d.createElement(s); + js.id = id; + js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; + fjs.parentNode.insertBefore(js, fjs); +}(document, 'script', 'facebook-jssdk'));</script> + + +<script> +$(function() { + return $("h2, h3, h4, h5, h6").each(function(i, el) { + var $el, id; + $el = $(el); + id = $el.attr('id'); + if (id) { + $el.removeAttr('id'); + return $el.before($("<a />").addClass('anchor').attr('name', id)); + } + }); +}); +</script> + +</body> +</html>