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

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

Ê×ÏÈÊÇÌá½»Ò³Ã棺Èý¸ö±íµ¥(form1,form2,form3)
         <form name="form1" method="post" action="checklogin.jsp" class="niceform">
            <input name="qx" type="hidden" value="3">
            <label for="textinput">ÕʺÅ:</label>
            <input type="text" id="textinput" name="uid" size="12" />
            <br />
            <label for="passwordinput">ÃÜÂë:</label>
            <input type="password" id="passwordinput" name="pwd" size="12" />
            <br />
            <input name="" type="submit" value="Ìá½»">
            <input type="reset" name="Submit2" value="ÖØÖÃ" />
          </form>
        </div>
        <div class=tagContent id=tagContent1>»¶Ó­Ê¹Óñ¾ÏµÍ³£¬ÇëÏÈ¡¾µÇ½¡¿»ò¡¾×¢²á¡¿¡£
          <form name="form2" method="post" action="checklogin.jsp" class="niceform">
            <input name="qx" type="hidden" value="2">
            <label for="textinput">ÕʺÅ:</label>
            <input type="text"


Ïà¹ØÎĵµ£º

ÎÒµÄJSPѧϰ±Ê¼Ç JSPÒ³ÃæÖеÄÈýÀà»ù±¾ÔªËØ

JSPÒ³ÃæµÄÈýÀà»ù±¾ÔªËØ
 
1.ÉùÃ÷
 
ÐÎÈç
<%!
      int a;
      int add(int a,int b)
      {
           return a+b;
       ......

jsp,servlet,strutsµÈ³öÏÖÂÒÂëµÄ½â¾ö°ì·¨¡£

1.Ê×ÏÈÒª±£Ö¤jspÒ³ÃæµÄ±àÂë¸ñʽ¡¢Êý¾Ý¿â±àÂë¸ñʽ¡¢javaÎļþ±£´æ¸ñʽ¡¢·þÎñÆ÷server.xmlÖеÄURIEncoding±àÂë¸ñʽ±£³ÖÒ»ÖÂ
2 ÊÖ¶¯Ð´Ò»¸ö¹ýÂËÆ÷£¬²¢ÇÒÔÚweb.xmlÎļþÖнøÐÐÅäÖá£
¾ßÌå´úÂë²Î¿¼ÈçÏ£¨µ÷ÊÔͨ¹ý£©£º
package cn.com.model2.util;
import java.io.IOException;
import javax.servlet.Filter;
import javax.se ......

jsp½ûÖ¹Ò³Ã滺´æ

1.½ûÖ¹¿Í»§¶Ë»º´æÒªÔÚ<head>ÖмÓÈëÀàËÆÈçÏÂÄÚÈÝ£º
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
2.ÔÚ·þÎñÆ÷µÄ¶¯Ì¬ÍøÒ³ÖнûÖ¹»º´æ£¬Òª¼ÓÈëÀàË ......

jspÉú³ÉÑéÖ¤Âë

ÑéÖ¤ÂëµÄÉú³É˼ÏëÊÇÔÚ·þÎñÆ÷¶ÎÔ¤ÏÈÉú³ÉºÃÑéÖ¤Â룬ǰ̨ÏÔʾ£¬È»ºóÔÙµ½ºǫ́ȥƥÅ䣡
code.jsp:
<%@ page language="java" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*"
contentType="image/jpeg" pageEncoding="UTF-8"%>
<% //ÉèÖÃÒ³Ãæ²»» ......

jspÖÐÎÄÂÒÂë½â¾ö·½°¸


1¡¢jspÒ³ÃæÂÒÂ룺
ÔÚjspÒ³Ã濪ʼÌí¼Ó<%pageEncoding="uft-8"%>
2¡¢servletÊä³öÂÒÂ룺
ÔÚÊä³öÄÚÈÝ֮ǰ£¬ÏÈÖ´ÐÐresponse.setContentType
("text/html;charset=utf-8")
3¡¢ÔÚformÀïÓÃpost·½Ê½Ìá½»²ÎÊý£º
1£©½ÓÊÕʱ¼Órequest.setCharacterEncoding("utf-8")
2£©Ê¹ÓùýÂËÆ÷£¬ÔÚ½ÓÊÕ²ÎÊý֮ǰ£¬É趨´«µÝµÄ²ÎÊýÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ