Struts 2.3.16 sx:submit targets not working as expected

穿精又带淫゛_ 提交于 2019-12-25 16:55:43

问题


I worked with Struts 2.0.11 and Struts 2.1.6 and have no problem with the s:submit or sx:submit with "targets" attribute. While upgrading our project from Struts 2.0.11 to 2.3.16, I have the following problem:

<head>
  <sx:head parseContent="true"/>
</head>
<s:form action="report_accumulatedResult" cssStyle="font-size :8pt; font-family: verdana" method="post" validate="true" >
<s:textfield        name="startDate"    label="Start Date"  size="15" cssClass="datepicker" />
<s:textfield        name="endDate"      label="End Date"  size="15" cssClass="datepicker" />

 <sx:submit  align="center" targets="report_result" showLoadingText="false" indicator="loadingImage"/>  

</s:form>

<img id="loadingImage" src="images/activityBarRefresh.gif" style="display:none" />

<s:div id="report_result" >
<%@ include file="/pages/incentive/reports/accumulatedResult.jsp" %>
</s:div>

In XML, I have something like:

<result name="ajax-result">/pages/incentive/reports/accumulatedResult.jsp</result>

Every time I submit the form, instead of showing my page in the div with id="report_result", the result page just appears occupying the whole page. It looks like the targets attribute is not working as expected. Does anyone has similar issue and any solution? Thanks.

来源:https://stackoverflow.com/questions/23481243/struts-2-3-16-sxsubmit-targets-not-working-as-expected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!