在struts2使用ajax时,配置result时需要配置其type为json。当添加了json-lib-2.3-jdk15.jar和struts2-json-plugin-2.3.4.1.jar两个包时,仍然还会报错:There is no result type defined for type 'json' mapped with name 'success'.在网上查了很多资料,说少了其他什么包,但试了都没用,主要可能struts版本不同。这里其实是需要修改struts.xml中的<package中的 extends="struts-default"为 extends="json-default"即可解决此错误。