Anda di halaman 1dari 7

Case study JSP-Ajax tag library

Subject:J2ee By:Anuj Singh Kanyal PRN:11030142043

Requirement: Ajax technology adds an edge to any website as there is no refresh the user also adore it. Implementing Ajax may require a j2ee developer to learn a new technology altogether. There are some standard use of ajax like auto complete feature to a site that could be used as a library. Should not break the existing MVC architecture. The library should be easily implemented to any JSP page. The library should have both Ajax and non Ajax support.

Architecture and Design information: A BaseUrl property defines the url of the servlet or jsp page that is going to service the request.

Syntax:
<%@ taglib prefix="ajaxtags" uri="http://ajaxtags.sourceforge.net/tags/ajaxtags " %>

Tag Summary
select toggle Builds the JavaScript required to populate a select box based on some event Builds the JavaScript required to toggle an image on/off. autocomplete Builds the JavaScript required to populate an input field as the user types.

updateField callout htmlContent tree tabPanel tab portlet area displayTag anchors editor submit

Builds the JavaScript required to update one or more form fields based on the value of another single field. Builds the JavaScript required to hook a callout or popup balloon to a link, image, or other HTML element's onclick event. Builds the JavaScript required to hook a content area (e.g., DIV tag) to a link, image, or other HTML element's onclick event Build a Treeview. This tag builds a panel to display a site as a tab. A Tab which is needed by the Tabpanel and present a site. Builds the JavaScript required to build a portlet style view. Builds the JavaScript required to wrap an area on the page with AJAX capabilities. Builds the JavaScript required to wrap a DisplayTag with AJAX capability. Builds the JavaScript required to rewrite HTML anchor tags with onclick events to enable AJAX capabilities. Builds the JavaScript required to create an in-place editor. Builds the JavaScript required to submit form and retrieve response via AJAX.

The jsp-ajax library works for all browser and it takes care of the javascripts enable/disable permission on the browser.

Code snippet for auto-complete feature:

<form>

Make: <input id="model" name="model" type="text" size="30" class="formautocomplete" /> Model: <input id="make" name="make" type="text" size="30" /> </form> <ajax:autocomplete baseUrl="$ {pageContext.request.contextPath}/GetMode l.view" source="make" target="model" parameters="model={model}" className="autocomplete" indicator="throbbing" minimumCharacters="1" />

Class Diagram:

Deployment Diagram:

Usage: Site using input box for search. Registration form to show the availability of username. Show an information based on the users selection. Site showing maps. Social networking sites.