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

checkbox ÔÚjspÖеÄʹÓÃ

 ±¾ÎÄ×÷ÕߣºØýÃû
ËùÊô·ÖÀࣺÍøÂç±à³Ì
¼ÓÈëʱ¼ä£º2006-1-19
µã»÷´ÎÊý£º396
<%@ page language="java" contentType="text/html" %>
<%@ page import="com.ora.jsp.util.*" %>
<html>
<body bgcolor="white">
<form action="checkbox.jsp">
<input type="checkbox" name="fruits" value="Apple">Apple<br>
<input type="checkbox" name="fruits" value="Banana">Banana<br>
<input type="checkbox" name="fruits" value="Orange">Orange<br>
<input type="submit" value="Enter">
</form>
<%
String[] picked = request.getParameterValues("fruits");
if (picked != null && picked.length != 0) {
%>
You picked the following fruits:
<form>
<input type="checkbox" name="fruits" value="Apple"
<%= ArraySupport.contains(picked, "Apple") ?
"checked" : "" %> >Apple<br>
<input type="checkbox" name="fruits" value="Banana"
<%= ArraySupport.contains(picked, "Banana") ?
"checked" : "" %> >Banana<br>
<input type="checkbox" name="fruits" value="Orange"
<%= ArraySupport.contains(picked, "Orange") ?
"checked" : "" %> >Orange<br>
</form>
<% } %>
</body>
</html>
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/miaowei2008/archive/2006/12/20/1450725.aspx


Ïà¹ØÎĵµ£º

jspÖÐÎÄÂÒÂëÎÊÌâ

 ½â¾ö°ì·¨£º  
µÚÒ»£º  
 1:ÔÚjspÒ³Ãæ¼ÓÈ룺  
<%@  page  contentType="text/html;  charset=gb2312"  %>  
 2:ÔÚservletÀïÃæ:  
   public  void  doGet(HttpServletRequest  request,  HttpServletResponse &nbs ......

jsp servletÖкº×ÖÂÒÂëµÄ½â¾ö°ì·¨

 package servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloBeijing extends HttpServlet{
//public void init(ServletConfig config) throws ServletException{
// super.init(config);
//}
public void service(HttpServletRequest request,HttpServlet ......

Tomcat JSP±àÒëÆ÷µÄÅäÖòÎÊý

 ÔÚconf/web.xmlÖÐÃûΪjspµÄservletÖпÉÒÔ¼ÓÈëһЩinit²ÎÊý
· checkInterval - Èç¹û“development”ÊôÐÔΪfalseÇÒ“checkInterval”´óÓÚ0£¬ÔòʹÓúǫ́±àÒë¡£“checkInterval”ÊDz鿴JSPÒ³Ãæ(°üÀ¨Æ丽ÊôÎļþ)ÊÇ·ñÐèÒªÖØбàÒëµÄÁ½´Î¼ì²éʱ¼ä¼ä¸ô£¨µ¥Î»£ºÃ룩¡£È±Ê¡ÖµÎª0Ãë¡£
&m ......

JSPÖÐincludeÖ¸ÁîºÍincludeÐÐΪµÄÇø±ð

 ÎÒÃǶ¼ÖªµÀÔÚjspÖÐincludeÓÐÁ½ÖÖÐÎʽ,·Ö±ðÊÇ
< %@ include file=” ”%>
< jsp:include page=” ” flush=”true”/>
¡¡¡¡Ç°ÕßÊÇÖ¸ÁîÔªËØ¡¢ºóÕßÊÇÐÐΪԪËØ¡£¾ßÌåËüÃǽ«Ôںδ¦Óã¿ÈçºÎÓü°ËüÃÇÓÐʲôÇø±ð£¿ÕâÓ¦¸ÃÊǺܶàÈË¿´µ½Ëü¶¼»áÏëµ½µÄÎÊÌâ¡£ÏÂÃæÒ»ÆðÀ´¿´¿´°É¡£
¡¡¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ