document.forms[0].action提交表单问题

function load(){ var iName = "<%=iName%>"; //alert(iName); document.forms[0].action = "<%=request.getContextPath()%>/DataQueryAction_toReal.do?iName="+iName; }<body onload="load()"> 提交不到action方法里,请高手解答报WARN [org.apache.struts2.components.ServletUrlRenderer] - No configuration found for the specified action: 'DataQueryAction_toReal.do' in namespace: ''. Form action defaulting to 'action' attribute's literal value.补充:<s:form action="DataQueryAction_toReal.do" namespace="" method="post">
2026-12-05 08:56:56
推荐回答(2个)
回答1:

struts2 中action的后缀名一般是".action"吧,看看你的xml 中配置是否一致。

回答2:

DataQueryAction_toReal.do 改成DataQueryAction_toReal.action