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

ÔÚ¶à¸öjspÒ³Ãæ´«µÝ²ÎÊý

1.       ÔõôÔÚ¶à¸öJSPÒ³ÃæÖ®¼ä½øÐвÎÊý´«µÝ£¿ÐèҪʹÓÃJSPµÄÄÚÖÃ×÷ÓÃÓò¶ÔÏósession¡£ÀûÓÃËüµÄÁ½¸ö·½·¨setAttribute()£¬getAttribute()
2.       ÏÂÃæµÄÕâ¸öʵÀýʵÏÖÁ˰ѵÚÒ»¸öJSPÒ³ÃæµÄ²ÎÊý´«µÝ¸øµÚÈý¸öÒ³ÃæµÄ¹¦ÄÜ
3.       ´úÂëÈçÏ£º1.jsp
[img][/img]
<html>
       <form method=get action=2.jsp>
       what's your name<input type=text name=username>
       <input type=submit value=submit>
       </form>
</html>
4.       2.jsp
<html>
      
       <form method=post action="3.jsp?pass=11">
       <%
              String name=request.getParameter("username");
              session.setAttribute("username",name);
       %>
       Your name is:<%=request.getParameter("username")%>
       <br>what's your hobby<input type=text name=hobby>
       <input type=submit value=submit>
       </form>
</html>
5.       3.jsp
<html>
       your name is:<%=session.getAttribute("username")%>
       <br>
       your hobby is:<%=request.getParameter("hobby")%>
       <br>
       your password is:<%=request.getParameter("pass")%>
   


Ïà¹ØÎĵµ£º

jspµÄ¸Å¿ö



 
JSP³£ÓÃÎÊ´ð
ÊÕ²Ø



< type="text/javascript">
document.body.oncopy = function() {
if (window.clipboardData) {
......

Servlet/JSPѧϰ±Ê¼Ç(4) ServletÈëÃÅ

½éÉÜÍ깤¾ßºÍ»ù±¾¸ÅÄÏÖÔÚÖÕÓÚ¿ªÊ¼½éÉÜServletµÄ±àд·½·¨ÁË¡£ÎªÁ˱ãÓÚÀí½â£¬ÎÒÃǽ«²ÉÓÃeclipse+Lomboz×÷Ϊ¿ª·¢»·¾³£¬Ò»ÇеIJÙ×÷¶¼¿ÉÒÔÔÚeclipseÖÐÍê³É¡£Èç¹ûÄ㻹ûÓа²×°ºÃLomboz£¬Çë²Î¿¼Ç°¼¸ÆªÎÄÕÂÅäÖúû·¾³¡£
tomcatºÍeclipseµÄ°²×°
»ù´¡ÖªÊ¶
Lomboz½éÉÜ+°²×°·½·¨
ÎÒÃǽ«½¨Á¢Ò»¸öÃûΪ com.idv2.learnjsp µÄ°ü£¬Ó ......

¹ØÓÚWEB¿ª·¢ jspµÄ°²È«ÐÔ

     ËäÈ»×öÁË´ó°ëÄêµÄweb¿ª·¢ÁË£¬µ«Ò»Ö±¸¡ÓÚ±íÃ棬¶«Î÷»á×ö£¬µ«ºÜ¶àÔ­Àí²»Í¨£¬ÒªÏë³ÉΪ¼¼ÊõÅ£È˹â»á×öÊÇÔ¶Ô¶²»Ðеģ¬ÒòΪ¼´Ê¹»á×öµ«²»»á½²ÇÒ²»ÄܾÙÒ»·´Èý£¬°¥£¬Ïëµ±Äê¸ßÖÐÊýѧ֮ËùÒÔÕâôºÃ¾ÍÊÇÒòΪ¸ßÖÐÊýѧԭÀíÎÒ¶¼Ò»Çå¶þ³þ£¬¾ÙÒ»·´Èý£¬ÐËÊÖÄíÀ´£¬·´¶øµ½ÁËÏÖÔÚÓе㼱¹¦½üÀû£¬¼±ÓÚÇó³É£¬ÎÒÕâ²»Êǵ¹ÍËÁË ......

jsp¾Å´óÄÚÖöÔÏó¡¢ËÄÖÖ×÷ÓÃÓò¡¢Ìøת·½Ê½

jspÓÐËÄÖÖÊôÐÔ·¶Î§£º
 page -> Ò³Ã漶±ð£¬ÏÔȻֻÓÐÔÚÒ»¸öÒ³ÃæÄÚ¿ÉÓá£
 request -> ÇëÇ󼶱ð ·þÎñÆ÷Ìøת£¬Ò»´ÎÇëÇóÖ®ºóÏûʧ¡£
 session -> »á»°¼¶±ð ¿Í»§¶ËÌøת£¨·þÎñÆ÷Ìøת£©£¬Óëä¯ÀÀÆ÷Óйأ¬ieÊÇÔÚÖØдò¿ªieʱ²Å»á²»Í¬¡£
 application = Ó¦Óü¶±ð£¬µ±ÖØÆô·þÎñÆ÷ʱ²Å»áÏûʧ
¿Í»§¶ËÌøת ......

JspÖÐFileUpload¿Ø¼þµÄʹÓÃ

       Ðí¾ÃûÓеǼ×Ô¼ºµÄУÄÚÍøÁË£¬½ñÌìµÇ¼ÁËһϣ¬ºöÈ»·¢ÏÖУÄÚµÄÉÏ´«ÕÕƬͦÓÐÒâ˼µÄ£¬ÓÚÊǺõ¾Í´ÓÍøÉÏÕÒÁËһϣ¬Ð£ÄÚÓ¦¸ÃÊÇʹÓÃjspдµÄ¡£ÔÚÍøÉÏÕÒµ½Á˸öFileUpload¿Ø¼þ£¬¿ÉÒԺܷ½±ãµÄÉÏ´«Îļþ¡£ÔÚÍøÉÏÕÒµ½Ò»ÆªÏêϸ½éÉÜÕâ¸ö¿Ø¼þʹÓõģ¬ÊÔÑéÁËһϣ¬¸ãÁ˺þòÅʵÏÖÏÖÔÚÕûÀí³öÀ´¡£
Ò»¡¢Ê× ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ