dz̸ÈçºÎʵÏÖJSPÉÏ´«Í¼Æ¬ÎÞ×é¼þ»¯(ת)
´ÓJSPҳʹͼƬÒÔJPEG±àÂëºó´æ´¢ÔÚÖ¸¶¨Îļþ¼ÐÖС£ÕâÖÖJSPÉÏ´«Í¼Æ¬·½Ê½Óë×é¼þÉÏ´«Ïà±ÈËÆºõ±¿×¾¶øÓÖ²»ÄܶÔÎļþÊôÐÔ½øÐвÙ×÷£¬µ«µÄÈ·¿ÉÒÔÇáËÉʵÏÖJSPÉÏ´«Í¼Æ¬µÄ¹¦ÄÜ¡£
¡¡¡¡uploadimage1.jspʵÏÖ¹¹½¨Ò»¸ö±íµ¥£¬Ìá½»ÓÃÓÚΪ
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css" mce_href="styles.css">
-->
</head>
<body>
This is my JSP page. <br>
<form action="MyJsp.jsp" method="post">
:<INPUT TYPE="text" NAME="name"><BR>
:<INPUT TYPE="file" NAME="image"><BR>
<INPUT TYPE="submit" value="t">
</form>
</body>
</html>
Í¼Æ¬ÖØÃüÃûµÄ²ÎÊý£¬ÒÔ¼°Í¼Æ¬Îļþ¡£
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page import="java.io.*"%>
<%@ page import="com.sun.image.codec.jpeg.*"%>
<%@ page import="java.awt.image.*"%>
<%@ page import="java.awt.*"%>
<%
String name=request.getParameter("name");
name=new String(name.getBytes("ISO-8859-1"));
String ima=request.getParameter("image");
out.print(name+"\n"+ima);
try{
String path=request.getRealPath("/");
FileOutputSt
Ïà¹ØÎĵµ£º
AjaxºÍjspµÄ¹ÖÏÖÏó
Èç¹ûÓÃAjaxÈ¥ÇëÇóÒ»¸öjspÒ³Ãæ£¬¸ÃjspÒ³Ãæ·µ»ØµÄÊÇxml£¨response.setContentType("text/xml; charset=GB2312");£©£¬²¢ÇÒ¸Ãjsp°üº¬ÏÂÃæÕâЩͷ@pageÖ¸ÁîµÄ»°£¬ÔòÔÚ¿Í»§¶Ëxml=XMLHttpRequest.responseXMLµÃµ½µÄÊÇÒ»¸ö²»°üº¬ÈÎÎñ¶«Î÷µÄxml¶ÔÏ󣬼´xml.childNodes.length½«»áÊÇ0.
......
Login.java
/******************************************************/
×¢Ò⣺ÓÉÓÚÔÚjspÖд´½¨Cookieʱ£¬±ØÐë±£Ö¤Cookie´´½¨Óï¾äдÔÚjspÒ³ÃæÍ·²¿µÄ<jsp:include page="includes\head.jsp" flush="true" />±êǩ֮ǰ²Å»áÉúЧ£¬·ñÔòÊÖ¶¯Ìí¼ÓµÄCookieʧ°Ü¡£
ËùÒÔÎÒ¾ö¶¨½²´´½¨CookieÓï¾ä·ÅÔÚservl ......
µÚÒ»²½£ºÏÂÔØj2sdkºÍtomcat
µ½sun¹Ù·½Õ¾£¨http://java.sun.com/j2se/1.5.0/download.jsp£©ÏÂÔØj2sdk£¬×¢ÒâÏÂÔØ°æ±¾ÎªWindows Offline InstallationµÄSDK£¬Í¬Ê±×îºÃÏÂÔØJ2SE 1.5.0 Documentation£¬È»ºóµ½tomcat¹Ù·½Õ¾µã£¨http://jakarta.apache.org/site/downloads/downloads_tomcat-5.cgi£©ÏÂÔØtomcat£¨ÏÂÔØ×îÐÂ5.5.9°æ±¾µ ......
×î»ù±¾µÄÂÒÂëÎÊÌâ
Õâ¸öÂÒÂëÎÊÌâÊÇ×î¼òµ¥µÄÂÒÂëÎÊÌâ¡£Ò»°ãлá³öÏÖ¡£¾ÍÊÇÒ³Ãæ±àÂë²»Ò»Öµ¼ÖµÄÂÒÂë¡£
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=iso8859-1"%>
<html>
<head>
<title>ÖÐÎÄÎÊÌâ</title>
<meta http-equiv="Co ......