2015-12-08 42 views
1
<a href="printAllocation.action?event=printAllocation&amp;fundAlias=%{fundAlias}&amp;fundName=%{fundName}&amp;lendFromMonth=%{lendFromMonth}&amp;lendFromYear=%{lendFromYear}&amp;partListDate=%{partListDate}&amp;partListType=%{partListType}&amp;secLendIncome=%{secLendIncome}" 
onClick="NewWindow(this.href,'Warning','1000','800','Yes');return false;"> 
      <s:submit value="Print" cssClass="btnRedApple"> 
      </s:submit></a> 

嗨!在上面的代碼中,我試圖通過使用錨點標記按鈕「print」但在新窗口中我沒有獲取值,因此將值從當前jsp傳遞到新窗口。如何通過struts2中的jsp將值傳遞到新窗口

這是爲struts2遷移完成的,因此任何人都可以幫助我解決此問題。如何將值傳遞到新窗口

+0

也將是有益的,看看你的JavaScript代碼NewWindow功能 –

回答

0

看起來您有一個包含許多參數的URL。更糟糕的是將URL包含在錨標記中。我建議你使用stuts 2.

Struts 2的「URL」標籤用於創建一個URL,並輸出爲文本格式 的s:url。它從不通過自己的工作,但對於其他 標籤要創建一個超鏈接或渲染圖像

<s:url action="printAllocation.action" var="urlTagValue" > 
    <s:param name="event">printAllocation</s:param> 
    <s:param name="fundAlias" value="%{fundAlias}"></s:param> 
    <s:param name="fundName" value="%{fundName}"></s:param> 
    ...//all the other parameters 
</s:url> 

這essentailly生成文本格式輸出象下面這樣它可以提供URL。

/theDomainOfYourWebApp/printAllocation.action?event=printAllocation&fundAlias=... 

添加,然後使用您的錨標記

<a href="<s:property value="#urlTagValue" />" onClick="NewWindow(this.href,'Warning','1000','800','Yes');return false;>URL Tag Action (via property)</a> 
+0

非常感謝我這樣試過,而且合作的.. :) – vijayashree

+0

@vijayashree歡迎你.. –

相關問題