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

jspʵÏÖÎļþÏÂÔØÓëÖÐÎÄÎļþÃûÂÒÂëÎÊÌâ½â¾ö

ÎÊÌâÈçÏ£º
֮ǰ,д¹ýÒ»¸öDownload.jspÎļþ,¿ÉÒÔ½â¾öÏÂÔØÎļþÂÒÂëÎÊÌâ(ÖîÈç:DOC,XSLÎļþµÈµÈ).
ºóÀ´·¢ÏÖ,Óöµ½ÖÐÎÄÃûµÄÎļþµÄʱºò,ÎļþÏÂÔØ½«»á±¨´í~~~~
½ñÌì,ͨ¹ý¸ÄдԭDownload.jspÎļþÒѾ­³¹µ×½â¾öÁËÕâ¸öÎÊÌâ~
ÏÖÔÚ,°ÑÒ»ÕûÌ×µÄÎļþÉÏ´«ÏÂÔØµÄ·½·¨¸øÌù³öÀ´~~~ÒÔ±ã´ó¼Ò½è¼ø!~!~!~!~! 
×÷Õß:¹Å°£¼°·¨ÀÏ
download.jspÎļþ
---------------------------------------------------------
<%
  java.io.BufferedInputStream bis=null;
  java.io.BufferedOutputStream  bos=null;
try{
 String filename=request.getParameter("filename");
             filename=new String(filename.getBytes("iso8859-1"),"gb2312");
 response.setContentType("application/x-msdownload");
 response.setHeader("Content-disposition","attachment; filename="+new String(filename.getBytes("gb2312"),"iso8859-1"));
 bis =new java.io.BufferedInputStream(new java.io.FileInputStream(config.getServletContext().getRealPath("files/" + filename)));
 bos=new java.io.BufferedOutputStream(response.getOutputStream()); 
 byte[] buff = new byte[2048];
 int bytesRead;
 while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
  bos.write(buff,0,bytesRead);
 }
}
catch(Exception e){
 e.printStackTrace();
}
finally {
 if (bis != null)bis.close();
 if (bos != null)bos.close();
}
%> 
×¢Ò⣬¹Ø¼ü¾ÍÊÇsetHeaderÀïµÄfilenameÐèÒªÖØÐ±àÂë,¸ñʽÊÇISO-8859-1¾Í£Ï£ËÁË
ÒÔÏÂÊÇÎÒ×Ô¼ºÏîÄ¿ÖÐÓõ½µÄ´úÂëÆ¬¶Ï£¬¹©²Î¿¼:
list.jsp: ÏÔʾ¸½¼þÃû³ÆµÄÒ³Ãæ
<tr>
            <td height="25" class="tdcor">¸½&nbsp;&nbsp;¼þ&nbsp;</td>
            <td colspan="3"&


Ïà¹ØÎĵµ£º

ÈçºÎÒ»¸öjspÒ³Ãæ´¦Àí¶à¸öform±íµ¥

Ê×ÏÈÊÇÌá½»Ò³Ãæ£ºÈý¸ö±íµ¥(form1,form2,form3)
         <form name="form1" method="post" action="checklogin.jsp" class="niceform">
            <input name="qx" type="hidden" value="3">
&nb ......

BBSϵͳ£¨jsp + servlet+dwr£©

ÓõÄÊÇMySqlÊý¾Ý¿â£¬ÀïÃæÓÐÊý¾Ý¿âµÄ½Å²½£¬ÔËÐÐbbs.sqlÎļþ¾Í¿ÉÒÔÁË¡£
ÓõÄMVCģʽ£¬ÓÃjsp ×öÏÔÊ¾Ò³Ãæ£¬ÓÃservlet×ö¿ØÖƲ㣬ÓÃJavaBean×öÄ£ÐͲã
ÏÂÔØµØÖ·£º
http://www.800disk.com/ContentPane.aspx?down=ok&filepath=lcbjava%2fMybbs.rar
°ÑÉÏÃæµÄµØÖ·¸´ÖƵ½ä¯ÀÀÆ÷¾Í¿ÉÒÔÏÂÔØ ......

jsp»ù´¡ÖªÊ¶£¨ÕûÀí£©

¸Õ¿ªÊ¼Ñ§jsp£¬×öµÄÒ»µãÌý¿Î±Ê¼Ç¡£
1.jspÈý´óÖ¸Áî
 <%@ page ~~~~~~~~ %>
 <%@ include file=""%>
 <%@ taglib  url="" prfix=""%>
2.if(username.equals(""))
 out.println("ÐÕÃû²»ÄÜΪ¿Õ£¬Çë<a href=javascript:history.back()>·µ»Ø")£»
&&·ÀÖ¹Ö±½ÓÔÚä¯À ......

Íê³ÉÄãµÄ×Ô¶¨ÒåJSP Tag±êÇ©£­Basic Coustom Tag

˵Ã÷£º»ùÓÚEclipse 3.2 + Tomcat 4.0±àÒëÍê³É
1.Íê³ÉÄã×Ô¼ºµÄTag Class£¬javax.servlet.jspÖÐÌṩһ¸öTag½Ó¿ÚÀà
TagSupport ºÍ BodyTagSupportÁ½¸öÀ࣬Äã×Ô¼ºµÄTag Class±ØÐë
extendsÆäÖÐÒ»¸ö¡£±¾ÀýÖÐHrefTag Class extends TagSupportÀ࣬²¢
Íê³ÉÁËdoStratTag·½·¨µÄÖØÐ´£¬Ö÷Òª´úÂëÈçÏ£º
public int doStartTag(){
J ......

JSP,ServletsºÍJavaBeanÀ´¹¹³ÉÒ»¸öϵͳµÄ¼¸ÖÖ;¾¶

JSP²ÊÉ«ÑéÖ¤Âë
Éú³ÉÓÐ4¸öËæ»úÊý×ÖºÍÔÓÂÒ±³¾°µÄͼƬ£¬Êý×ֺͱ³¾°ÑÕÉ«»á¸Ä±ä£¬·þÎñÆ÷¶ËˢУ¨ÓÃhistory.go(-1)Ò²»á±ä£©
Ô­ÐͲο¼ALIBABA http://china.alibaba.com/member/showimage
²úÉúÑéÖ¤ÂëͼƬµÄÎļþ-----image.jsp
&lt;%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,java ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ