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

JSPÂÒÂë´¦Àí´óÈ«

Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
¶þ¡¢±íµ¥Ìá½»ÖÐÎÄʱ³öÏÖÂÒÂë
Èý¡¢Êý¾Ý¿âÁ¬½Ó
´ó¼ÒÔÚJSPµÄ¿ª·¢¹ý³ÌÖУ¬¾­³£³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌ⣬¿ÉÄÜÒ»ÖÁÀ§ÈÅ×ÅÄú£¬ÎÒÏÖÔÚ°ÑÎÒÔÚJSP¿ª·¢ÖÐÓöµ½
µÄÖÐÎÄÂÒÂëµÄÎÊÌâ¼°½â¾ö°ì·¨Ð´³öÀ´¹©´ó¼Ò²Î¿¼¡£
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
ÏÂÃæµÄÏÔʾҳÃæ(display.jsp)¾Í³öÏÖÂÒÂ룺
<html>
<head>
<title>JSPµÄÖÐÎÄ´¦Àí</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
out.print("JSPµÄÖÐÎÄ´¦Àí");
%>
</body>
</html>
¶Ô²»Í¬µÄWEB·þÎñÆ÷ºÍ²»Í¬µÄJDK°æ±¾£¬´¦Àí½á¹û¾Í²»Ò»Ñù¡£Ô­Òò£º·þÎñÆ÷ʹÓõıàÂ뷽ʽ²»Í¬ºÍä¯ÀÀÆ÷
¶Ô²»Í¬µÄ×Ö·ûÏÔʾ½á¹û²»Í¬¶øµ¼Öµġ£½â¾ö°ì·¨£ºÔÚJSPÒ³ÃæÖÐÖ¸¶¨±àÂ뷽ʽ(gb2312),¼´ÔÚÒ³ÃæµÄµÚÒ»
ÐмÓÉÏ£º<%@ page contentType="text/html; charset=gb2312"%>£¬¾Í¿ÉÒÔÏû³ýÂÒÂëÁË¡£ÍêÕûÒ³ÃæÈçÏÂ
£º
<%@ page contentType="text/html; charset=gb2312"%>
<html>
<head>
<title>JSPµÄÖÐÎÄ´¦Àí</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
out.print("JSPµÄÖÐÎÄ´¦Àí");
%>
</body>
</html>
¶þ¡¢±íµ¥Ìá½»ÖÐÎÄʱ³öÏÖÂÒÂë
ÏÂÃæÊÇÒ»¸öÌá½»Ò³Ãæ(submit.jsp)£¬´úÂëÈçÏ£º
<html>
<head>
<title>JSPµÄÖÐÎÄ´¦Àí</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form name="form1" method="post" action="process.jsp">
<div align="center">
<input type="text" name="name">
<input type="submit" name="Submit" value="Submit">
</div>
</form>
</body>
</html>
ÏÂÃæÊÇ´¦ÀíÒ³Ãæ(process.jsp)´úÂ룺
<%@ page contentType="text/html; charset=gb2312"%>
<html>
<head>
<title>JSPµÄÖÐÎÄ´¦Àí</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%=request.getParameter("name")%>
</body>
</html>
Èç¹ûsubmit.jspÌá½»Ó¢ÎÄ×Ö·ûÄÜÕýÈ·ÏÔʾ£¬Èç¹ûÌá½»ÖÐÎÄʱ¾Í»á³öÏÖÂÒÂ


Ïà¹ØÎĵµ£º

jsp·ÖÒ³

Ô´³ÌÐò
<%String sConn="ÄãµÄÁ¬½Ó"
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection(sConn,"ÄãµÄÓû§Ãû","ÃÜÂë");
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Statement stmtcount=conn.createStat ......

ÔÚJSPÒ³ÃæÖÐÓÃselectÏÂÀ­ÁбíÀ´ÏÔʾListÁбíµÄ·½Ê½

Ò» ¡¢ ÓÃstruts2±êÇ©µÄ<s:selectÀ´ÏÔʾ
<s:select cssStyle="width: 84%" list="#application.officeList" headerKey="" headerValue="--ÇëÑ¡Ôñ--" listKey="#this.value" listValue="#this.key+'.'+#this.value" name="entity.officeName" value="entity.officeName"/>
ÆäÖÐ
1¡¢listÊǽÓÊÕjavaÀà»òÕßÔÚÆô¶¯Ê± ......

JSP·ÖÒ³¼¼ÊõʵÏÖ

title: JSP·ÖÒ³¼¼ÊõʵÏÖ
summary:ʹÓù¤¾ßÀàʵÏÖͨÓ÷ÖÒ³´¦Àí
author: evan_zhao
email: evan_zhao@hotmail.com
¡¡¡¡Ä¿Ç°±È½Ï¹ã·ºÊ¹ÓõķÖÒ³·½Ê½Êǽ«²éѯ½á¹û»º´æÔÚHttpSession»òÓÐ״̬beanÖУ¬·­Ò³µÄʱºò´Ó»º´æÖÐÈ¡³öÒ»Ò³Êý¾ÝÏÔʾ¡£ÕâÖÖ·½·¨ÓÐÁ½¸öÖ÷ÒªµÄȱµã£ºÒ»ÊÇÓû§¿ÉÄÜ¿´µ½µÄÊǹýÆÚÊý¾Ý£»¶þÊÇÈç¹ûÊ ......

JSP¾Å¸öÄÚÖöÔÏó

ѧϰJ2EE£¬±ØÐë¶ÔÏÂÃæµÄ¼¸¸ö¶ÔÏóÓкÜÉîµÄÀí½â
1¡¢request   ->  javax.servlet.http.HttpServletRequestµÄʵÀý
     ¸Ã¶ÔÏó·â×°ÁËÒ»´ÎÇëÇ󣬿ͻ§¶ËµÄÇëÇó²ÎÊý¶¼±»·â×°ÔڸöÔÏóÀï¡£ÕâÊÇÒ»¸ö³£ÓõĶÔÏ󣬻ñÈ¡¿Í»§¶ËÇëÇó²ÎÊý±ØÐëʹÓøöÔÏó¡£³£Óõķ½·¨ÓÐgetParameter(String pa ......

JSP ×é¼þÉÏ´«Îļþ£¨common fileupload£©

µÚ1¸öÉÏ´«×é¼þcommons-fileupload
=============commons-fileupload ================
common-fileupload×é¼þÊÇapacheµÄÒ»¸ö¿ªÔ´ÏîÄ¿Ö®Ò»£¬¿ÉÒÔ´Óhttp://jakarta.apache.org/commons/fileupload/ÏÂÔØ¡£¸Ã×é¼þ¼òµ¥Ò×Ó㬿ÉʵÏÖÒ»´ÎÉÏ´«Ò»¸ö»ò¶à¸öÎļþ£¬²¢¿ÉÏÞÖÆÎļþ´óС¡£
-ÏÂÔغó½âѹzip°ü£¬½«commons-fileupload-1.1. ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ