首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

struts2 jquery json 相关有关问题

2012-09-27 
struts2 jquery json 相关问题1. ERROR [http-8080-1] - Could not find action or result?项目片段描述:a

struts2 jquery json 相关问题

1. ERROR [http-8080-1] - Could not find action or result?

项目片段描述:ajax登录,需要返回json格式数据判断

?

?struts.xml

?

?

<package name="ajax" extends="json-default" namespace="/ajax">  <action name="login" method="login"> <result name="success" type="json" > <param name="root">result</param> </result> </action> </package>

?

xx.jsp

?

?

<script>jQuery(function($) {//button$("#login").button();$("#reset").button();//dialog$('#dialog_link').click(function(){$('#dialog').dialog({height:180,width:400});return false;});//ajax login$("#login").click(function(){$.ajax({type:"post",url:"ajax/login",data:"user.username="+$("#username").val()+"&user.password="+$("#password").val(),dataType:"json",success: function(result){alert(result);window.location.href="http://localhost:8080/jf/map";}});})});</script>

?

反复检查后,依然出现下面问题:No result defined for action com.hspc.jf.web.action.UserAction and result login

?

原因是缺少了jar包,不得不吐槽下,这尼玛的提示。。。几乎没有作用么

?

补充 2012-2-13(2B节,哥们还在写代码struts2 jquery json 相关有关问题

提出一点当缺少?struts2-json-plugin ?的时候,会提示

?

ERROR [main] - Unable to find parent packages json-default

?

以下是maven中依赖

?

<dependency><groupId>net.sf.json-lib</groupId><artifactId>json-lib</artifactId><version>2.4</version><type>jar</type><classifier>jdk15</classifier><scope>compile</scope></dependency><dependency><groupId>org.apache.struts</groupId><artifactId>struts2-json-plugin</artifactId><version>2.1.8.1</version><type>jar</type><scope>compile</scope></dependency>
??

还有一点,我很好奇maven依赖中有冲突conflicted会肿么样

?

struts2 jquery json 相关有关问题

热点排行
Bad Request.