我使用的是struts-2.1.8版本。css
一、導入struts2-dojo-plugin-2.1.8.jar,這個能夠在struts解壓包裏找到。ajax
二、在用使用dojo的頁面引入url
<%@taglib prefix="sx" uri="/struts-dojo-tags" %>
三、導入js標籤庫spa
<sx:head/>
到此struts和dojo便整合完畢,咱們就能夠在頁面上使用struts-dojo的標籤了。code
struts-dojo的標籤有:head、div、a、submit、bind、datetimepicker、tabbedpanel、textarea、autocompleter。orm
貼幾個應用的例子get
div標籤:input
<s:url id="test1" value="test.action"></s:url> <sx:div theme="ajax" cssClass="testCss" href="%{test1}">正在加載數據...</sx:div>
提交表單的submit標籤:it
<s:form action="test2.action" onsubmit="return check()"> <input name="test2" id="test2"/> <sx:submit type="button" targets="mydiv" label="提交"></sx:submit> </s:form> <div id="mydiv"></div>