title: Struts 2 jquery plugin javascript error
body: <p>I have a Struts 2 application that use Tiles 3 and Struts 2 Jquery Plugin.</p>
  
  <p>In the pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;com.jgeppert.struts2.jquery&lt;/groupId&gt;
    &lt;artifactId&gt;struts2-jquery-plugin&lt;/artifactId&gt;
    &lt;version&gt;3.7.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>head.jsp:</p>
  
  <pre><code>&lt;%@ page contentType="text/html" pageEncoding="UTF-8" %&gt;
  &lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;
  &lt;%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %&gt;
  &lt;%@ taglib prefix="sj" uri="/struts-jquery-tags" %&gt;
  
  &lt;s:head /&gt;
  
  &lt;!-- struts jquery head --&gt;
  &lt;sj:head /&gt;
  
  &lt;!-- struts bootstrap head --&gt;
  &lt;sb:head /&gt;
  
  &lt;!-- main stylesheet --&gt;
  &lt;link href="static/css/main.css" rel="stylesheet"&gt;
  
  &lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --&gt;
  &lt;!--[if lt IE 9]&gt;
      &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt;
  &lt;![endif]--&gt;
  </code></pre>
  
  <p>The javascript console of the browser displays the following error: <code>Uncaught TypeError: Cannot set property 'version' of undefined</code></p>
  
  <p>The tag <code>&lt;sj:head /&gt;</code> print the following lines:</p>
  
  <pre><code>&lt;script type="text/javascript" src="/MyApp/struts/js/base/jquery-1.11.0.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/MyApp/struts/js/base/jquery.ui.core.min.js?s2j=3.7.1"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="/MyApp/struts/js/plugins/jquery.subscribe.min.js?s2j=3.7.1"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" src="/MyApp/struts/js/struts2/jquery.struts2.min.js?s2j=3.7.1"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
      $(function () {
          jQuery.struts2_jquery.version = "3.7.1";
          jQuery.scriptPath = "/MyApp/struts/";
          jQuery.struts2_jquery.gridLocal = "en";
          jQuery.struts2_jquery.timeLocal = "en";
          jQuery.ajaxSettings.traditional = true;
  
          jQuery.ajaxSetup({
              cache: false
          });
  
          jQuery.struts2_jquery.require("js/struts2/jquery.ui.struts2.min.js?s2j=3.7.1");
  
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The line that generate the undefined error is:</p>
  
  <pre><code>jQuery.struts2_jquery.version = "3.7.1";
  </code></pre>
  
  <p>After some javascript debug it seems that the function <code>$.subscribeHandler</code> is not defined.</p>