jspÂÒÂë½â¾ö´óÈ«(ת×ÔcsdnÒ»¸ßÊÖ)
Ò»¡¢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 »º´æ£¬ html »º´æ£¬ ajax»º´æ,½â¾ö·½·¨
url:http://blog.csdn.net/oklzh/archive/2009/08/14/4445722.aspx
ÓйØÒ³Ã滺´æÎÊÌ⣮Õâ¸öÎÊÌâÉÏÍøÕÒÁ˺ö࣮µ«·¢¾õ¸÷ÖÖ½â¾ö·½·¨£¬¶¼±Ë´Ë·ÖÀ룬ûÓÐһƪͳһµÄ½â¾ö·½·¨£¬±¾È˽üÈÕ£¬Ò²Óöµ½ÁËÒ³Ã滺´æµÄÎÊÌ⣬¸ù¾ÝÍøÉϸ÷Ò³Ã滺´æµÄ½â´ð£¬×öÁËÒ»¸ö×ܽᡣ
1.·þÎñÆ÷¶Ë»º´æµÄÎÊÌâ ......
×î½üÔڸıðÈ˵ÄÒ»¸öÄ£¿é³ÌÐòʱ£¬ÊÇÓÃIntellij Idea8×öµÄ£¬ÏîÄ¿ÊÇÓÃMavenÀ´¹ÜÀíµÄ£¬WebÄ£¿éÒýÓõ½ÁËjsp-api.jarºÍservlet-api.jar£¬½á¹ûÔÚÓÃMaven´ò°üʱ£¬warÎļþÖÐÖ±½Ó°ü×°ÁËÕâÁ½¸öÎļþ£¬¶øÕâÁ½¸öÎļþºÍTomcat±¾ÉíµÄÎļþÓгåÍ»£¬µ¼ÖÂÁËÓ¦ÓóÌÐò²»ÄܼÓÔØ¡£
±¾À´×Ô¼º¶ÔIdeaÒ²²»ÊìϤ£¬ ......
Õâ¸öÎÊÌâµÄÈ·ºÜ·³ÈË£¬Æäʵ¶¼ÊÇMyEclipseµÄ"×Ô×÷´ÏÃ÷"ºÍ·ÃÎÊÍøÂçÉϵÄAPI DocµÄ½á¹û£¨ËüĬÈÏÓÃVisual DesignerÀ´´ò¿ªµÄ£©£¬½øÐÐÏÂÁÐÉèÖü´¿ÉÓÐЧ»º½âÖ®¡£
1. ҪôÓÒ¼üµ¥»÷Îļþ£¬Ñ¡Ôñ Open With -¡· MyEclipse JSP Editor ´ò¿ª£¬ÕâÑù²»»á²ÉÓÿÉÊÓ»¯µÄ´ò¿ª£¬ºÄ×ÊÔ´ÉÙ£¬×Ô¶¯ÌáʾҲ·Ç³£¿ì¡£
2. Ҫô²ÉÈ¡Ò»ÀÍÓÀÒݵķ½·¨ Window ......
----*web.xml *----
----*web.xml *----
<filter>
<filter-name>MyFilter</filter-name>
<filter-class>cray.util.MyFilter</filter-class>
</filter>
<filter-mapping>
<fi ......
ÕâÁ½¸öÐÇÆÚ³ýÁËרҵ¿Î·½ÃæµÄѧϰ£¬Ò»Ö±ÔÚѧϰJSP£¬ÓõÄÊÇ¡¶21ÌìѧͨJAVA WEB¿ª·¢¡·Õâ±¾»ù´¡ÈëÃŽ̲ģ¬Êé±¾Éæ¼°µ½µÄ¶«Î÷²¢²»¶à£¬Ñ§µÄ»¹ÊÇһЩ±È½ÏdzÏԵĶ«Î÷°É¡£Ò²ÐíºÜ¶à¶«Î÷ÕæµÄÒª½Ó´¥ÁËÖ®ºó²Å»áÓиоõ£¬×÷Ϊ¸Õ¸Õ½Ó´¥web¿ª·¢µÄ²ËÄñ¶øÑÔ£¬Äܹ»½«Ð´µÄ¶«Î÷ÔËÐÐÆðÀ´ÕæµÄºÜÓгɾ͸У¬(*^__^*) Îû ......