webʵÑ鱨¸æ——JSP¶¯Ì¬ÍøÒ³±à³Ì
ʵÑ鱨¸æ
Ò». »ù±¾Ë¼Â·¼°ÊµÑé½á¹û£¨¼Ç¼¸÷ÖÖÔËÐÐÇé¿ö»òÒ³ÃæµÄÔËÐÐЧ¹û£©£»
1¡¢Ê¹ÓÃTOMCAT·þÎñÆ÷ÅäÖÃjspÓ¦ÓÃ
1£©´ò¿ªTOMCAT/webapps×ÓĿ¼£¬´´½¨Ò»webÓ¦Óã¨Èçmyweb£©£¬½«example0.jspÓëexample1.jspÎļþ¸´ÖÆÈëÄÚ£¬²¢ÔÚ¸ÃĿ¼ÏÂÉèÖÃWEB-INFĿ¼¼°web.xmlÅäÖÃÎļþ£»
2£©ÔÚä¯ÀÀÆ÷µØÖ·À¸ÊäÈëhttp://localhost:8080/myweb/example0.jsp £¬»Ø³µºó£¬²é¿´example0.jspÍøҳЧ¹û
ÔËÐнá¹û£º
3£©ÔÚä¯ÀÀÆ÷µØÖ·À¸ÊäÈëhttp://localhost:8080/myweb/example1.jsp £¬»Ø³µºó£¬²é¿´example1.jspÍøҳЧ¹û£»
2¡¢±àд»ù±¾JSP¶¯Ì¬ÍøÒ³
1£©´´½¨date.jsp£¬Ò³ÃæÔËÐÐЧ¹ûÓ¦¸ù¾Ýµ±Ç°ÏµÍ³Ê±¼äÊä³ö£º
“£¨ÉÏÎç¡¢ÏÂÎç¡¢ÍíÉÏ£©ºÃ£¡ ½ñÌìÊÇ__ __Äê_ ___ÔÂ__ __ÈÕ£¬ÐÇÆÚ£¨Ò»~ÈÕ£©¡£”£»
[²Î¿¼´úÂ룺Date today=new Date(); thisYear= 1900+today.getYear();]
Ô´´úÂ룺
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Date</title>
</head>
<body>
<%
//CalendarÕâÀàÀ´±íʾʱ¼ä£¬ÏÖÔÚ¸ü³£Óã¬ËùÒÔÎÒÑ¡ÔñʹÓÃÁËÕâ¸ö
Calendar date = Calendar.getInstance();//µÃµ½Calendar¶ÔÏ󣬲»Äܼòµ¥µØÓÃnewÀ´´´½¨
int year = date.get(Calendar.YEAR);//Äê
int month = date.get(Calendar.MONTH)+1;//Ô£¬Ðè+1À´µ÷Õû
int day = date.get(Calendar.DATE);//ÈÕ
int weekDay = date.get(Calendar.DAY_OF_WEEK)-1;//ÐÇÆÚ¼¸
String[] sweekDay = {"ÈÕ","Ò»","¶þ","Èý","ËÄ","Îå","Áù"};//½²Ó¢ÎıíʾΪÖÐÎÄ
int hour = date.get(Calendar.HOUR_OF_DAY);//µÃµ½ÏÖÔÚÊǼ¸µã
String weclome =
Ïà¹ØÎĵµ£º
request, reponse, out, session, application, config, pagecontext, page, exception.
Ò».request¶ÔÏ󣺸öÔÏó·â×°ÁËÓû§Ìá½»µÄÐÅÏ¢£¬Í¨¹ýµ÷ÓøöÔÏóÏàÓ¦µÄ·½·¨¿ÉÒÔ»ñÈ¡·â×°µÄÐÅÏ¢£¬¼´Ê¹ÓøöÔÏó¿ÉÒÔ»ñÈ¡Óû§Ìá½»ÐÅÏ¢¡£
1.Request¶ÔÏó¿ÉÒÔʹÓÃgetParameter(string s)·½·¨»ñÈ¡¸Ã±íµ¥Í¨¹ýtextÌá½»µÄÐÅÏ¢¡£È磺
Requ ......
½üÆÚµÄÒ»¸öÏîÄ¿ÐèҪʵÏÖÉãÏñͷͼÏñ²É¼¯£¬¾¹ýһϵÁеÄÕÛÌÚÒÔºó£¬ÖÕÓÚʵÏÖÁËÕâ¸ö¹¦ÄÜ£¬ÏÖÕûÀíһϡ£
±¾Éí¾Íjava¼¼ÊõÀ´Ëµ£¬ÒªÊµÏÖÉãÏñÍ·¶þ´Î¿ª·¢£¬²É¼¯ÉãÏñͷͼƬ£¬ÐèҪʹÓõ½JMF£¬JMFÊʺÏʹÓÃÔÚj2se³ÌÐòµ±ÖУ¬ÎÒÐèÒªÔÚweb³ÌÐòÖе÷ÓÃÉãÏñÍ·£¬ºÜÃ÷ÏÔJMFÊǸ㲻¶¨ÁË£¬Ïë¹ýдһ¸öapplet³ÌÐò£¬Ö»ÊÇÄǶ«Î÷ÒªÇó¿Í»§¶Ë±ØÐëÒªÓÐjre»·¾ ......
1.JSPÖÐÒ³Ã涨ʱˢÐÂ
Java
´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://penghuaiyi.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3C%25%0A%20%20 ......
Ò»¡¢¸ÅÊö
»º´æµÄ˼Ïë¿ÉÒÔÓ¦ÓÃÔÚÈí¼þ·Ö²ãµÄ¸÷¸ö²ãÃæ¡£ËüÊÇÒ»ÖÖÄÚ²¿»úÖÆ£¬¶ÔÍâ½ç¶øÑÔ£¬ÊDz»¿É¸ÐÖªµÄ¡£
Êý¾Ý¿â±¾ÉíÓлº´æ£¬³Ö¾Ã²ãÒ²¿ÉÒÔ»º´æ¡££¨±ÈÈ磺hibernate£¬»¹·Ö1¼¶ºÍ2¼¶»º´æ£©
ÒµÎñ²ãÒ²¿ÉÒÔÓлº´æ£¨µ«Ò»°ãÀ´Ëµ£¬ÕâÊÇÒ»¸ö¹ý³ÌÓò£¬²»»áÉ軺´æ£©¡£
&nbs ......