ÇëÎÊjsp javabeanÊÇÔõôºÍÓû§ÊäÈëÁªÏµµÄ
Óе÷ÊԺõÄÁ½¸öÎļþ£¬ÓÃÀ´Í¨¹ýjavabeanÏÔʾÓû§ÊäÈëµÄ×Ö·û´®£º
sample1.jsp£¬´úÂëÈçÏ£º
<%@ page contentType="text/html; charset=GBK"%>
<html>
<head>
<title>
web7
</title>
</head>
<jsp:useBean id="sample1BeanId" scope="page" class="Bean.sample1Bean"/>
<jsp:setProperty name="sample1BeanId" property="sample"/>
<body>
<h1>
A JSP&Bean Sample
</h1>
<form method="post">
<br> Enter new value: <input name="sample"> <br>
<br> <br>
<input type="submit" name="Submit" value="Submit">
<input type="reset" value="Reset">
<br>
Value of Bean property is :
<jsp:getProperty name ="sample1BeanId" property="sample"/>
</form>
</body>
</html>
»¹ÓÐÒ»¸öÊÇsample1Bean.java£¬´úÂëÈçÏ£º
package Bean;
public class sample1Bean
{
private String sample ="start value";
public String getSample()
{
return sample;
}
public void setSample(String sample)
{
sample = sample;
}
}
ÇëÎÊ£º£¨´ð³öÀ´Ò»Ìõ¾ÍÓ
Ïà¹ØÎÊ´ð£º
//Óÿͻ§µÄsessionµÄid½¨Á¢Ò»¸öÁÙʱÎļþ£º
//String tempFileName=(String)session.getId();
String tempFileName = (String)session.getId();
//out.println(& ......
jsÖеķ½·¨£¬²»ÄÜÔÚjspÖе÷ÓÃÔõô½â¾ö£¿¼±£¡£¡!
²»Ã÷°×Òâ˼
ºÃºÃ¼ì²éÊDz»ÊÇ·¾¶µÄÎÊÌ⣬ºÜÓпÉÄÜ·¾¶²»¶Ôµ¼Öµ÷Óò»µ½
Ìùһϵ÷ÓõĴúÂë¿´¿´°¡~~
ÓÐûÓÐÕýÈ·ÒýÓÃjs£¿º¯ÊýÓÐûÓгõʼ»¯£¿....
jsp´úÂë±¾À´¾ ......
ÎÊÌâÃèÊö£º
ÀýÈçÎÒÒªÏÔʾµÄÄÚÈÝÈçÏÂËùʾ
Ò»¼¶Ä¿Â¼1
Ò»¼¶Ä¿Â¼1×ÓÀà1
×ÓÀà1
Ò»¼¶Ä¿Â¼1×ÓÀà2
......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......