ÓÃjavabeanÔÚJSPÒ³ÃæÖÐʵÏÖ½ø¶ÈÌõЧ¹û
public class TaskBean extends Thread{
public TaskBean(){
}
private int percent=0;
private boolean complete=false;
public synchronized void run() {
while(true){
if(percent>=100){
complete=true;
return;
}
try {
Thread.sleep(1000);
} catch (Exception e) {
System.err.println("TaskBean.run()"+e.getMessage());
}
percent+=10;
}
}
public boolean isComplete(){
return complete;
}
public int getPercent(){
return percent;
}
}
start.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
&n
Ïà¹ØÎĵµ£º
µ±ÔÚJSPµÄpageÖ¸ÁîÖÐÉèÖÃerrorPage="url"¾Í¿ÉÒÔÉèÖô¦ÀíÒ쳣ʼþµÄJSPÎļþ¡£Èç¿ÉÒÔÕâÑùд£º
<%@ page errorPage="error.jsp" %>
ÕâÑùµÄ»°£¬µ±Ò³ÃæÖгöÏÖÒì³£µÄÊ ......
context.xml Îļþ¼ÐÖÐ
<Context path="/wap"
docBase="D:\IDE\MyEclipse\wap\WebRoot" reloadable="false" >
request.getContextPath(); -==> /wap
this.getServletContext().getRealPath("") ;// D:\IDE\MyEclipse\wap\WebRoot
......
ÃæµÄÉϱã»áµ¯³öÓò¿ØÑéÖ¤µÄ
¸÷λ,ÉÏ´ÎÔÚȺÖÐÎʵ½¹ØÓÚJsp WEBϵͳµÇ¼ÓëÓò¿Ø½áºÏ×öÓû§ÑéÖ¤µÄÎÊÌâ,ÏÖÔÚÒѾ½â¾ö,½«½â¾ö°ì·¨Óë¸÷λ·ÖÏíÏÂ:
½â¾ö·½°¸:ʹÓÃsamba×éÖ¯µÄ¿ªÔ´ÏîÄ¿jCIFS
ÏîÄ¿Ê×Ò³:http://jcifs.samba.org/
²Î¿¼×ÊÁÏ:
ʹÓÃjcifs.jar¿ÉÒԷdz£ºÃʵÏÖ£¬ÏÂÔØÒ»¸ö×îеÄjcifs.jar£¬·Åµ½WEB-INFlibÏÂÃ棬ȻºóÐÞ¸Ä ......
JSP¾Å´óÄÚÖöÔÏó£º
1.ÓëServletÓйصÄÒþº¬µÄ¶ÔÏó
(1)page page¶ÔÏó¶ÔÓ¦JavaÖеĹؼü×Öthis,Ëü´ú±íµ±Ç°JSPÒ³Ãæ
(2)config Config¶ÔÏóʹÓÃWebÈÝÆ ......
scopeÊôÐÔÓÃÓÚÖ¸¶¨JavaBeanʵÀý¶ÔÏóËù´æ´¢µÄÓò·¶Î§£¬ÆäÈ¡ÖµÖ»ÄÜÊÇpage¡¢request¡¢sessionºÍapplicationËĸöÖµÖеÄÒ»¸ö£¬ÆäĬÈÏÖµÊÇpage¡£
ÎÒ¿ÉÒÔ²âÊÔÏÂÃæ´úÂ룺
date.jsp
---------------------------------------------------------
<jsp:useBean i ......