dojo

struts2.1.X结合使用dojo:
struts2.0及以前,其对dojo的ajax支持是放在struts2-core-2.0.X.jar包中的;
struts2.1后,默认的dojo ajax支持被从core包中抽出放入了struts2-dojo-plugin-2.1.8.jar中。网上2.0及之前版本与dojo的结合例子多的是,这里说下2.1.8.1配置dojo:
jar:
引用
struts2-core-2.1.8.1.jar
struts2-dojo-plugin-2.1.8.jar

Troubleshooting guide migrating from Struts 2.0.x to 2.1.x:
https://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html
引用
Reference the new taglib in your JSP or FTL pages.
Before (2.0的用法)
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>

After (2.1及之后的用法)
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>




Update the head tag
Before:
<s:head theme="ajax"/>

After:
<sx:head parseContent="true"/>




The web.xml before (matching all requests):
<filter>
	<filter-name>struts2</filter-name>
	<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
	<filter-name>struts2</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>

Change to use the new StrutsPrepareAndExecuteFilter and match just struts requests.

The web.xml after:
<filter>
	<filter-name>struts2</filter-name>
	<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>

<filter-mapping>
	<filter-name>struts2</filter-name>
	<url-pattern>*.action</url-pattern>
</filter-mapping>

<filter-mapping>
	<filter-name>struts2</filter-name>
	<url-pattern>/struts/*</url-pattern>
</filter-mapping>


万一遇到 'dojo' is undefined 未定义 错误:
http://www.coderanch.com/t/445316/Struts/struts-dojo-undefined
引用
Well, that won't work well unless you've extracted the static files out of the Struts jar.

As the S2 documentation states, the expected filter mapping is "/*". This is because Struts contains static files (the Dojo libraries, in this case), and expects to see *every* request, so it can serve those files.

By mapping to something other than the recommended mapping you're bypassing the default S2 behavior, and must adjust your deployment accordingly.



Struts 2与AJAX
http://www.blogjava.net/max/archive/2007/06/12/123682.html

Dojo Require 相关问题(怎样加载自定义的dijit)
http://hi.baidu.com/yz20090909/blog/item/3bae6629e22501f1e6cd4082.html

dojo.io.bind
Dojo入门教程之dojo.io.bind详解:
http://www.zhuoda.org/weiking/94629.html
error: function(type, error) { alert(error.message); }, //error is dojo.io.Error 

dojo.io.bind 介绍:
http://www.blogjava.net/zolly/archive/2006/10/25/Dojo_Introduction.html

dojo.require("dijit.layout.ContentPane");
http://api.dojotoolkit.org/jsdoc/HEAD/dijit.layout.ContentPane.setContent

你可能感兴趣的:(JavaScript,.net,Ajax,struts,dojo)