在struts2中的同一页面中显示操作结果

时间:2012-12-16 13:32:49

标签: ajax jquery struts2 struts2-jquery struts2-json-plugin

我正在尝试在同一页面中显示结果,但它在单独的页面中显示结果。操作是向会话添加属性,我想显示该属性的值。

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<html>
  <head>
   <sx:head/>
   <sj:head/> 
  </head>
<body>
   <%@include file="menu.jsp" %> `
<sj:tabbedpanel id="localtabs" cssStyle="content-left">
  <sj:tab id="tab1"  target="tone" label="Recommend Tests"/>
  <sj:tab id="tab2" target="ttwo" label="Recommend Dose"/>
  <div id="tone">
     <s:form action="saveSuggestedTests" theme="xhtml">
        <s:optiontransferselect
         label="Select Tests"
         name="leftNumber"
         list="%{activeTestsMap}"
         doubleName="rightNumber"
         doubleList="returnMap"
         labelposition="top"
        />
        <sj:submit name="submit" value="Submit" indicator="indicator"  targets="result"/>
     </s:form>
     <div id="result" class="result ui-widget-content ui-corner-all"></div>        
  </div>

struts.xml具有以下配置

<action name="saveSuggestedTests" class="org.arshiya.struts.action.tests.TestsManagerHelper" method="saveSuggestedTests">
            <result name="success">/WEB-INF/result.jsp</result>
             <result name="error">/WEB-INF/login.jsp</result>
            <result name="login">/WEB-INF/login.jsp</result>
            <result name="input">/WEB-INF/createUser.jsp</result>
</action>

0 个答案:

没有答案