0

I am trying to show result in same page but it is showing result in separate page. The action is adding attribute to the session, I want to show the value of that attribute as a result.

<%@ 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 have following configuration

<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>
user1907867
  • 3
  • 1
  • 5
  • The settings looks correct to me. What's in the result.jsp? – Quincy Dec 17 '12 at 07:12
  • What do you mean "in separate page"? Does it displays result.jsp in a new page or current page is being refreshed? – Aleksandr M Dec 17 '12 at 19:53
  • Sorry for delay in reply as I am new to this site ans was looking for answer status in profile page. @aleksandr-m it shows result.jsp in same page but page gets refreshed so my tabs are gone. I want result to be displayed in same tab (ajax type) by refreshing same page/half page without affecting tabs. but result.jsp opens in new page. – user1907867 Dec 19 '12 at 18:12
  • @Quincy result.jsp doesn't contain anything other than printing action result put in session. – user1907867 Dec 19 '12 at 18:12
  • The code you have posted should work just fine. Do you get exceptions or javascript errors? Also where do you have put a `` tag? – Aleksandr M Dec 19 '12 at 20:12
  • @Aleksandr-m I have following code above the tabbedpanel code shown in first code snippet – user1907867 Dec 20 '12 at 04:43
  • I am not getting any exception or javascript error but result page opening and showing result. instead of showing code snippet over here, I added it in the above code snippet itself to make it more readable. Thanks for your response. – user1907867 Dec 20 '12 at 04:53
  • You are mixing `dojo` with `jQuery` it might be the cause of your problem. – Aleksandr M Dec 20 '12 at 09:40
  • @aleksandr-m tried removing dojo but even then it has same behavior :( – user1907867 Dec 20 '12 at 14:33
  • Are you sure that there are not any javascript errors? Use `console` tab of firebug to see javascript errors. – Aleksandr M Dec 20 '12 at 21:13
  • I have tried the similar thing and it is working fine for me. – Gaurav Parek Aug 20 '15 at 07:54

0 Answers0