Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JspÖÐFileUpload¿Ø¼þµÄʹÓÃ

       Ðí¾ÃûÓеǼ×Ô¼ºµÄУÄÚÍøÁË£¬½ñÌìµÇ¼ÁËһϣ¬ºöÈ»·¢ÏÖУÄÚµÄÉÏ´«ÕÕƬͦÓÐÒâ˼µÄ£¬ÓÚÊǺõ¾Í´ÓÍøÉÏÕÒÁËһϣ¬Ð£ÄÚÓ¦¸ÃÊÇʹÓÃjspдµÄ¡£ÔÚÍøÉÏÕÒµ½Á˸öFileUpload¿Ø¼þ£¬¿ÉÒԺܷ½±ãµÄÉÏ´«Îļþ¡£ÔÚÍøÉÏÕÒµ½Ò»ÆªÏêϸ½éÉÜÕâ¸ö¿Ø¼þʹÓõģ¬ÊÔÑéÁËһϣ¬¸ãÁ˺þòÅʵÏÖÏÖÔÚÕûÀí³öÀ´¡£
Ò»¡¢Ê×ÏȵÃÏÂÔØÈý¸öjar°ü
1. commons-FileUpload 1.2 °ü
  ÏÂÔصØÖ·:http://jakarta.apache.org/commons/fileupload/
2. commons-IO 1.3.1 °ü
  ÏÂÔصØÖ·:http://jakarta.apache.org/commons/io/
3. Commons-BeanUtils 1.7 °ü
  ÏÂÔصØÖ·:http://jakarta.apache.org/commons/beanutils/
¶þ¡¢Ð½¨Ò»¸ö½ÐuploadµÄWEBÏîÄ¿£¬½«ÏÂÔصÄѹËõ°ü½âѹcopyÆäÖеÄjarÎļþÖÁuploadÎļþ¼ÐÏÂWEB-INF/libĿ¼ÖУ¬ÏîÄ¿²»ÄÜ×Ô¶¯¼ÓÔصĻ°ÐèÒªÔÚ¿ª·¢¹¤¾ßÀïÃæÊÖ¶¯¼ÓÔØһϡ£
Èý¡¢ÎÒʹÓõÄÊÇjsp + ºó¶Ë servletµÄ·½Ê½ÉÏ´«Îļþ£¬×¼±¸Ò»·ÝÈçÏÂÄÚÈݵÄupload.jspÎļþ,ÓÃÀ´Ñ¡ÔñÒªÉÏ´«µÄÎļþ¡£´úÂëÈçÏ£º
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ÉÏ´«Îļþ</title>
</head>
<body>
<form name="upform" action="UploadServlet" method="post" enctype="multipart/form-data">
<input type ="file" name="file1" id="file1"/><br/>
<input type ="file" name="file2" if="file2"/><br/>
<input type ="file" name="file3" id="file3"/><br/>
<input type="submit" value="Submit" /><br/>
<input type="reset" />
</form>
</body>
</html>

ÉÏÃæÎļþÖÐÓм¸¸öÐèҪעÒâµÄµØ·½¾ÍÊÇ
1. action="UploadServlet" ±ØÐëºÍºóÃæµÄweb.xmlÅäÖÃÎļþÖжÔservletÓ³Éä±ØÐë±£³ÖÒ»ÖÂ.
2. method="POST" ÕâÀï±ØÐëΪ"POST"·½Ê½Ìá½»²»ÄÜÊÇ"GET".
3. enctype="multipart/form-data" ÕâÀïÊÇÒªÌá½»µÄÄÚÈݸñʽ,±íʾÄãÒªÌá½»µÄÊÇÊý¾ÝÁ÷,¶ø²»ÊÇÆÕͨµÄ±íµ¥Îı¾.
4. file1,file2,file3±íʾÄãÒª3¸öÎļþÒ»ÆðÉÏ´«,ÄãÒ²¿ÉÒÔÒ»´ÎÖ»ÉÏ´«Ò»¸öÎļþ.
ËÄ¡¢Ð´Ò»¸öÓëÉÏÃæÕâ¸öupload.jspÅäÌ×µÄservlet³ÌÐò,¾Í½Ð×öUploadServlet.java,ÒÔÏÂÊǸÃservletµÄÏêϸ´


Ïà¹ØÎĵµ£º

ÓйØJSP/ServletµÄÖض¨Ïò¼¼Êõ

 
ÓйØJSP/ServletµÄÖض¨Ïò¼¼Êõ×ÛÊöÈçÏÂ
1.RequestDispatcher.forward()
    ÊÇÔÚ·þÎñÆ÷¶ËÆð×÷ÓÃ,µ±Ê¹ÓÃforward()ʱ,Servlet engine´«µÝHTTPÇëÇó´Óµ±Ç°µÄServlet or JSPµ½ÁíÍâÒ»¸öServlet,JSP »òÆÕͨHTMLÎļþ,Ò²¼´ÄãµÄformÌá½»ÖÁa.jsp,ÔÚa.jspÓõ½ÁËforward()Öض¨ÏòÖÁb.jsp,´ËʱformÌá½»µÄËùÓÐÐÅÏ¢ ......

jspµÄ¸Å¿ö



 
JSP³£ÓÃÎÊ´ð
ÊÕ²Ø



< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
......

jspÔËÐл·¾³µÄÅäÖÃ

      Õâ¶Îʱ¼äÔÚѧϰJSP£¬×ÜÌåÀ´Ëµ£¬JSPѧϰÆðÀ´¸Ð¾õ»¹²»´í£¬²»ÖªµÀÊDz»ÊÇÓÐÁËJAVAµÄ¹¦µ×£¬Ã»¸Õ¸Õ¿ªÊ¼Ñ§Ï°CÓïÑÔµÄʱºòÄÇô³ÔÁ¦¡£²»¹ÜÊÇҪѧϰJSP»¹ÊÇÆäËû±à³ÌÓïÑÔ£¬ÎÒÃǶ¼Ó¦¸ÃÄÜѧ»á×Ô¼ºÊìÁ·µÄ°²×°ºÍÅäÖÃÐèÒªÓõ½µÄ¿ª·¢Èí¼þ¡£ÓÐÁË¿ª·¢Èí¼þ¾Í»áÊ°빦±¶¡£Ð´´úÂëÒ²»á¸ü¿ì½ÝºÍ·½±ã£¬ÓÐЩ¹Ø¼ü´Ê»ò´íÎ ......

FCKeditor2.6 for JSP ÅäÖ÷½·¨

1¡¢Ê×Ïȵǽwww.fckeditor.net/downloadÏÂÔØFCKeditorµÄ×îа汾£¬ÐèÒªÏÂÔØ2¸öѹËõ°ü£¬Ò»¸öÊÇ»ù±¾Ó¦Óã¬ÁíÒ»¸öÊÇÔÚΪÔÚjspÏÂËù×¼±¸µÄÅäÖá£
      FCKeditor 2.6 ÏÂÔصØÖ·£ºsourceforge.net/project/downloading.php
      FCKeditor.Java ÏÂÔصØÖ·£ºsourceforge.net/ ......

ÓÃJFreeChartÔöÇ¿JSP±¨±íµÄÓû§ÌåÑé

  
   
      JFreeChartÊÇÒ»×鹦ÄÜÇ¿´ó¡¢Áé»îÒ×ÓõÄJava»æͼAPI£¬Ê¹ÓÃËü¿ÉÒÔÉú³É¶àÖÖͨÓÃÐԵı¨±í£¬°üÀ¨Öù״ͼ¡¢±ýͼ¡¢ÇúÏßͼ¡¢¸ÊÌØͼµÈ¡£ËüÄܹ»ÓÃÔÚSwingºÍWebµÈÖÐÖÆ×÷×Ô¶¨ÒåµÄͼ±í»ò±¨±í£¬²¢Çҵõ½¹ã·ºµÄÓ¦Óᣱ¾ÎĽ«Í¨¹ýÒýÁì¶ÁÕßѧϰÔÚJFreeChartÖбýͼ¡¢Öù״ͼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ