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

JSPÎļþ

<%@ page language="java" import="kg.TestBean2;" %>
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<head>
<title>HelloBean</title>
</head>
<body>
<%--
<%
kg.TestBean2 testbean=(kg.TestBean2)session.setAttribute("testbean");
if(testbean==null){
testbean = new kg.TestBean2();
session.setAttribute("testbean",testbean);
}
%>
--%>
<jsp:useBean id="testbean" class="kg.TestBean2" scope="page" />
<%--
<jsp:setProperty name="testbean" property="myText" />
<jsp:getProperty name="testbean" property="myText"/>
<jsp:setProperty name="testbean" property="myPassword"/>
<jsp:getProperty name="testbean" property="myPassword"/>
--%>
<jsp:setProperty name="testbean" property="*"/>
Óû§Ãû£º<%=new String(testbean.getMyText().getBytes("ISO8859_1"),"GBK")%>
ÃÜÂ룺<%=testbean.getMyPassword()%>
</body>
</html>


Ïà¹ØÎĵµ£º

jsp useBean scopeÊôÐÔµÄÇø·Ö

      scopeÊôÐÔÓÃÓÚÖ¸¶¨JavaBeanʵÀý¶ÔÏóËù´æ´¢µÄÓò·¶Î§£¬ÆäÈ¡ÖµÖ»ÄÜÊÇpage¡¢request¡¢sessionºÍapplicationËĸöÖµÖеÄÒ»¸ö£¬ÆäĬÈÏÖµÊÇpage¡£
      ÎÒ¿ÉÒÔ²âÊÔÏÂÃæ´úÂ룺
date.jsp
---------------------------------------------------------
<jsp:useBean i ......

JSP×Ô¶¨Òå±êÇ©

JSP×Ô¶¨Òå±êÇ©
Ò»£¬    »ù±¾¸ÅÄ
±êÇ©(Tag):±êÇ©ÊÇÒ»ÖÖXMLÔªËØ£¬Í¨¹ý±êÇ©¿ÉÒÔʹJSPÍøÒ³±äµÃ¼ò½àÒ×ÓÚά»¤£¬»¹¿ÉÒÔ·½±ãµØʵÏÖͬһ¸öJSPÎļþÖ§³Ö¶àÖÖÓïÑÔ°æ±¾¡£ÓÉÓÚ±êÇ©ÊÇXMLÔªËØ£¬ËùÒÔËüµÄÃû³ÆºÍÊôÐÔ¶¼ÊÇ´óСдÃô¸ÐµÄ¡£
±êÇ©¿â(Tag library)£ºÓÉһϵÁй¦ÄÜÏàËÆ£¬Âß¼­ÉÏ»¥ÏàÁªÏµµÄ±êÇ©¹¹³ÉµÄ¼¯ºÏ³ÆΪ±êÇ©¿ ......

ÓÃServlet¹ýÂËÆ÷È¥³ýJSPÒ³ÃæÖеÄÂÒÂë


import java.io.IOException;   
  
import javax.servlet.Filter;   
import javax.servlet.FilterChain;   
import javax.servlet.FilterConfig;   
import javax.servlet.ServletException;   
import javax.servle ......

JSPÓï·¨Ïê½â

HTML ×¢ÊÍ
ÔÚ¿Í»§¶ËÏÔʾһ¸ö×¢ÊÍ.
JSP Óï·¨
<!-- comment [ <%= expression %> ] -->
Àý×Ó 1
<!-- This file displays the user login screen -->
ÔÚ¿Í»§¶ËµÄHTMLÔ´´úÂëÖвúÉúºÍÉÏÃæÒ»ÑùµÄÊý¾Ý£º
<!-- This file displays the user login screen -->
Àý×Ó 2
<!-- This page was ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ