JSPÒ³Ãæ±íµ¥Ìá½»ÎÊÌ⣿
<script language="javaScript">
function select()
{
document.selectpages.selectnum.value=document.selectpages.selectpage.value;
document.selectpages.submit();
}
</script>
<form name="selectpages" action="index.jsp" >
µÚ
<select name="selcetpage" onChange="select()">
<%
for(int m=1;m <=pagebean.TotalPage();m++)
{
%>
<option value=" <%=m %>" <%=pagebean.getCurrentPage()==m?"selected":""%>> <%=m %> </option>
<%
}
%>
</select>
Ò³
<input type="hidden" name="selectnum" value="">
</form>
ÇëÎÊÒ»ÏÂ
ÎÒÏ뵱ѡÔñÁËÏÂÀÁбíÖеÄij¸öÖµµÄʱºò °ÑÕâ¸öÖµ´øµ½servletÀïÈ¥´¦Àí
¿ÉΪʲôÕâ¸ö±íµ¥²»Äܱ»Ìá½»£¿
ÄǸöindex.jspÊÇÎҷŵ½±¾ÒµÈ¥²âÊԵģ¬ÔÚ±¾ÒµÒ²²»ÄÜÌá½»
Õâ¸öÊÇÎÒÏëÒªÌá½»µÄÄ¿µÄµØ£ºaction=" <%=request.getContextPath() %>/StuServlet?method£½ifseleced"
ÐÖµÜÄãÖ¸¶¨Ìá½»·½·¨ÁËÂ𣿠<form name="selectpages" action="index.jsp" method="post"
Ïà¹ØÎÊ´ð£º
ÎÒÔÚjspÒ³Ãæ´æÉÏÒ»¸ösession,±¾Ò³Ã滹¿ÉÒÔÈ¡³öÖµÀ´.
µ«ÊÇһˢÐÂ,»òÕß´ò¿ªÐµÄÒ³Ãæ¾ÍÈ¡²»³öÖµÀ´ÁË.
Ææ¹ÖµÄÊÇ,ÎÒ²âÊÔÁíÒ»¸ö³ÌÐòʱºò
ÔÚjspÒ³Ãæ´æÉÏÒ»¸ösession,±¾Ò³Ãæ¿ÉÒÔÈ¡³öÖµÀ´,ˢлò´ò¿ªÐÂÒ³ÃæÖµÄÜÈ¡³öÀ´ÁË.
......
°üÀ¨²ÎÊý
String path = request.getContextPath();
String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/"; ......
ÎҵĿª·¢µÄƽ̨ÊÇMyeclipes6.0 + tomcat5.x + mysql
ÎÒËùÓеıàÂ뷽ʽ¶¼ÊÇÓõÄUTF-8
ÎÒÖ»ÓÃÁËStrtus¿ò¼Ü
ÔÚÒ»¸öformÖÐÈçÏÂÓõÄÊÇpostµÄÌá½»·½Ê½£º
<form class="form" action=&quo ......
ÎÒ°ÑjavabeanµÄÔ´´úÂëSetGetPropertytest.Java·ÅÔÚC:\tomcat\webapps\mywork\WEB-
INF\classes\comÖÐ ÊDz»ÊÇÎҵİü´´½¨´íÁË»¹ÊÇ£¿ÒªÊǽ¨´íÁË,ËÄܸæËßÎÒÔõô½¨Âð? лл´ó¼Ò
Ç°À´°ï棬ͬʱף´ó¼ÒÖÐÇï¿ ......
´ó¼ÒºÃ£¡ÎÒÏÖÔÚÔÚ×öÒ»¸öÍøÉÏÊéµê£¬Óöµ½Ò»Ð©ÎÊÌ⣬ÇóÖúÏ£º
ÒªÇóÊÇÕâÑùµÄ£º
°ÑÒ»±¾ÊéÍϽøÒ»¸ö¹ºÎï³µ£¬¹ºÎï³µ¾Í¶àÁËÕâ±¾Ê飬
´Ó¹ºÎï³µÍϳöÒ»±¾Ê飬Ȼºó¹ºÎï³µ¾ÍÉÙÁËÕâ±¾Ê飻
¸ßÊÖÇëÖ¸µãÏ ......