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

½â¾öjsp»òserverlet ²»ÄܽâÎömultipart/form

½â¾öjsp»òserverlet ²»ÄܽâÎömultipart/form-data ÀàÐÍµÄ±íµ¥ÓòµÄÎÊÌâ
10 6ÔÂ 2008
Situation:
Javax.servlet.HttpServletRequest.getParameter(String) returns null when the ContentType is multipart/form-data
Solutions:
Solution A:
1. download http://www.servlets.com/cos/index.html
2. invoke getParameters() on com.oreilly.servlet.MultipartRequest
Solution B:
1. download http://jakarta.apache.org/commons/sandbox/fileupload/
2. invoke readHeaders() in
org.apache.commons.fileupload.MultipartStream
Solution C:
1. download http://users.boone.net/wbrameld/multipartformdata/
2. invoke getParameter on
com.bigfoot.bugar.servlet.http.MultipartFormData
Solution D:
Use Struts. Struts 1.1 handles this automatically.
Solution E:
use jspSmartUpload compounds
http://ckasj.vicp.net/dokuwiki/doku.php/freespace:smart_upload


Ïà¹ØÎĵµ£º

jsp»òÓÃjs»ñµÃ·þÎñÆ÷µÄIPµØÖ·

jsºÃÏñ±¾Éí²»ÄÜ»ñÈ¡·þÎñÆ÷µÄIP,µ«JSP¿ÉÒÔ£¬ËùÒÔÓøöÒþ²ØÓò£¬js¾Í¿ÉÒԽ輦ϵ°ÁË¡£
jsp´úÂëÈçÏ£º
<input   type="hidden" id="serviceIp"   name="serviceIp"   value="<%=InetAddress.getLocalHost().getHostAddress()%>">
js´úÂëÈçÏ£º
function getServiceIP(){
var ser ......

jsp Servlet½Å±¾ÔªËØ¡¢Ö¸ÁîºÍÔ¤¶¨Òå±äÁ¿

12.1 JSP½Å±¾ÔªËØ
¡¡¡¡ JSP½Å±¾ÔªËØÓÃÀ´²åÈëJava´úÂ룬ÕâЩJava´úÂ뽫³öÏÖÔÚÓɵ±Ç°JSPÒ³ÃæÉú³ÉµÄServletÖС£½Å±¾ÔªËØÓÐÈýÖÖ¸ñʽ£º
±í´ïʽ¸ñʽ£¼%= expression %£¾£º¼ÆËã±í´ïʽ²¢Êä³öÆä½á¹û¡£
Scriptlet¸ñʽ£¼% code %£¾£º°Ñ´úÂë²åÈëµ½ServletµÄservice·½·¨¡£
ÉùÃ÷¸ñʽ£¼%! code %£¾£º°ÑÉùÃ÷¼ÓÈëµ½ServletÀࣨÔÚÈκη ......

includeºÍjsp:include

index.jsp:
<html>
<head>
<title>The News</title>
</head>
<body>
<h1> Latest News</h1>
<table>
<tr>
<td><h3><%@include file="items/news1.jsp" %></h3></td>
</tr>
<tr>
<td> ......

ÔÚjspÖÐʹÓÃsmartupload×é¼þÉÏ´«Îļþ

 
ÔÚjspÖÐʹÓÃsmartupload×é¼þÉÏ´«Îļþ
   jsp¶ÔÉÏ´«ÎļþµÄÖ§³Ö²»ÏóphpÖÐÖ§³ÖµÄÄÇôºÃ£¬Ö±½Ó×ö³ÉÁ˺¯Êý£¬Ò²²»ÏóaspÖÐҪͨ¹ý×é¼þ²ÅÄÜʵÏÖ¡£jspÖпÉÒÔͨ¹ýjavabeanÀ´ÊµÏÖ¡£µ«ÊÇÎÒÃÇûÓбØÒª×Ô¼ºÈ¥Ð´Ò»¸öÉÏÔØµÄbean£¬ÔÚÍøÉÏÒѾ­ÓÐÁ˺ܶà³ÉÐ͵ļ¼Êõ£¬smartupload¾ÍÊÇÆäÖеÄÒ»¸ö¡£µ«ÊÇsmartuploadÊǽ«ÎļþÏȶÁµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ