Quick Start

From AjaxTags 1.3

The new version has some big changes. The new API has changed the name-space so you need to check your imports. You need to replace package names from import org.ajaxtags. to import net.sourceforge.ajaxtags..

Another step is to implement the >BaseAjaxXmlAction> interface You need to make sure that AjaxActionHelper#invoke is called this is provieded by BaseAjaxServlet and will be provieded again for struts in future release

First follow the steps at install page

Prepare JSP View

Your JSP, of course, is where it all comes together.

  1. declare the taglib
  2. include a reference to the JavaScript source
  3. include a reference to any CSS required
  4. add your content
  5. include the AJAX tag you want to use.
    <!--Step 1 -->
    <%@ taglib uri="http://ajaxtags.org/tags/ajax" prefix="ajax" %>
    <!-- ..... -->
    
    <html>
    <head>
      <title>AJAX JSP Tag Library</title>
    
    
    <!--Step 2 -->
    <script type="text/javascript" src="js/prototype.js"></script>
    <script type="text/javascript" src="js/scriptaculous/scriptaculous.js"></script>
    <script type="text/javascript" src="js/overlibmws/overlibmws.js"></script>
    <script type="text/javascript" src="js/ajaxtags.js"></script>
    
    
    <!--Step 3 -->
      <!-- defaults for Autocomplete and displaytag -->
      <link type="text/css" rel="stylesheet" href="/css/ajaxtags.css" />
      <link type="text/css" rel="stylesheet" href="/css/displaytag.css" />
    
    
    </head>
    <body>
    
    
    <!--Step 4 -->
    <form>
      Make:
      <select id="make" name="make">
        <option value="">Select make</option>
        <c:forEach items="${makes}" var="make">
          <option value="${make}">${make}</option>
        </c:forEach>
      </select>
    
      Model:
      <select id="model" name="model">
        <option value="">Select model</option>
      </select>
    </form>
    
    
    <!--Step 5 -->
    
    <ajax:select
      baseUrl="${pageContext.request.contextPath}/GetCarModel.view"
      source="make"
      target="model"
      parameters="make={make}" />
    
    
    
    </body>
    </html>

Servlet example handler

TODO

Next: Usage

See how they're used.