来源:
http://www.theserverside.com/news/thread.tss?thread_id=35792项目主页:
http://ajaxtags.sourceforge.net/The AJAX Tag Library, a set of JSP tags that simplify the use of Asynchronous JavaScript and XML (AJAX) technology in JavaServer Pages, has been released.
This tag library offers five tags for common AJAX functionality:
* autocomplete: retrieves a list of values that matches the string entered in a text form field as the user types
* callout:displays a callout or popup balloon, anchored to an HTML element with an onclick event
* Select/dropdown: based on a selection within a dropdown field, a second select field will be populated
* toggle: switches a hidden form field between true and false and at the same time switches an image between two sources
* update field: updates one or more form field values based on response to text entered in another field
Usage of the autocomplete tag (from the online demo) looks like this: in an HTML form, a normal input field is used:
<input id="model" name="model" type="text" autocomplete="off" size="30" class="form-autocomplete" />
Then, later in the JSP page, the autocomplete tag is specified, with a reference to this input field:
<ajax:autocomplete
fieldId="model"
popupId="model-popup"
targetId="make"
baseUrl="${contextPath}/autocomplete.view"
paramName="model"
className="autocomplete"
progressStyle="throbbing" />
The autocomplete.view request is resolved to a servlet that extends BaseAjaxServlet, which then returns data in a predefined format that the tag uses to populate the list, which is a fairly standard use of AJAX.
--
FROM 211.151.91.*