2012-02-18 62 views

回答

2

ASP.NET不能與普通JSP進行比較。 JSP更像「經典ASP」。如果您正在尋找ASP.NET(-MVC)的Java對應部分,請查看JSF。例如PrimeFacesa <p:tabView> component,我認爲這正是你要找的。

在普通的JSP中,您需要引入一些JavaScript代碼來執行Ajax請求,並操縱HTML DOM和一些Servlet以返回必要的數據。 jQuery,也許jQuery UI可能會對此有所幫助。

+0

PrimeFaces是非常好的BalusC。我會試一試。非常感謝你。但我仍然想要一個不使用第三方庫的代碼。任何人請幫助... – 2012-02-18 18:56:10

+0

那麼,只需編寫相應的JavaScript/Ajax和Servlet代碼即可。你知道嗎,我認爲?如果沒有,我會開始學習它。 MDN有一個非常好的JS/Ajax教程。畢竟,如果不是幾個小時而不是幾個小時甚至更少的時間,只需要幾個星期就可以完成它,同時具有相同程度的穩健性和交叉瀏覽器兼容性。如果您遇到特定的編碼問題,您可以隨時在此發佈問題。 – BalusC 2012-02-19 03:39:45

+0

感謝BalusC,但我沒有足夠的時間去學習一件新事物。我必須儘快提交我的項目。並且非常感謝您的幫助:)我將嘗試首先使用PrimeFaces – 2012-02-19 05:46:57

0

隨着你的代碼我們也很無奈..

試試下面的代碼比其他的div一個div的內容畫面更改爲其他一些圖像上的鼠標。經過一些修改,它可能會達到您的要求。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Untitled Document</title><br /> 

</head> 

<body> 
<p> 
    <script type="text/javascript" language="javascript"> 
function changeImage(img){ 
    document.getElementById('bigImage').src=img; 

} 
</script> 

    <img src="../Pictures/lightcircle.png" alt="" width="284" height="156" id="bigImage" /> 
<p>&nbsp; </p> 
<div> 
    <p> 
    <img src="../Pictures/lightcircle2.png" height=79 width=78 onmouseover="changeImage('../Pictures/lightcircle2.png')"/> 

</p> 
<p><img src="../Pictures/lightcircle.png" alt="" width="120" height="100" onmouseover="changeImage('../Pictures/lightcircle.png')"/></p> 

<p><img src="../Pictures/lightcircle2.png" alt="" width="78" height="79" onmouseover="changeImage('../Pictures/lightcircle2.png')"/></p> 

<p>&nbsp;</p> 


    </br> 
</div> 
</body> 
</html> 

Link to the question

相關問題