struts2 and Dojo

A definition from
Dojo is a collection of JavaScript utilities providing solutions for a vast array of problems faced by the professional JavaScript developer. Dojo Base is the foundation of the Dojo Toolkit and functionality such as DOM and AJAX convenience methods, animations, and other base functionality suitable for building simple Web sites. Dojo Core is a larger set of components built upon Dojo Base and includes things such as drag and drop, l10n and i18n components, and data stores. 

Dijit is a complete widget system, providing all core UI components and utilities, andDojoX is a collection of advanced components, including data grids, low-level graphics libraries, mobile components, and other experimental software. Finally, the Utilities section provides extensive information about theDojo Build systemDojo Module Loader, and a variety of other Dojo-related utilities.

Dojo toolkit is very use for those who  don’t want to work with JavaScript . As I am not good in JavaScript that is why i am seeking for some thing different. then i came to know about Dojo here is the simple example that i have done in struts2 and Dojo by using Dojo plugin. for this your have to first download the dojo plugin and put it in the libraries of your project .

Step-1 Download dojo plugin

Now right click on the libraries in your struts2 project > Add Jar/folder > now give the location of the dojo plugin that you have just downloaded > select dojo plugin > cilck ok.

copy and paste the following files


<%@ taglib prefix=”s” uri=”/struts-tags” %>

Struts2 and dojo



<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>

Struts2 and dojo


package struts2.dojo;
import com.opensymphony.xwork2.ActionSupport;
import java.util.ArrayList;
import java.util.List;

public class Action extends ActionSupport{
    private List al = new ArrayList();
private String yourname;
public Action(){

    public List getAl() {
        return al;

    public void setAl(List al) { = al;
    public String getYourname() {
        return yourname;
    public void setYourname(String yourname) {
        this.yourname = yourname;
public String display() {
return "success";


<%@ taglib prefix=”s” uri=”/struts-tags” %>

Struts2 and dojo

your Name :


NOTE - It is recommended that you should use jQuery with Struts2 rather than dojo. 
Dojo is very rich and make the work easy but the use of Dojo with struts2 will be deprecated.