MyEclipseÖÐÐÞ¸ÄĬÈÏJSP±à¼Æ÷µÄ·½·¨.txt
ÔÚMyEclipseÖпª·¢WEBÓ¦ÓÃʱ¾³£Òª´´½¨JSPÎļþ£¬µ«ÊÇÿ´ÎMyEclipse¶¼»áÓÃĬÈϵÄMyEclipse Visual JSP Designer£¬´ò¿ªËٶȷdz£Âý£¬¶øÇÒ»ù±¾ÉÏÒ²Óò»µ½Õâ¸ö¿ÉÊÓ»¯µÄJSP±à¼Æ÷£¬¶à°ë¶¼ÊÇʹÓÃMyEclipse JSP Editor£¬ËùÒÔ£¬ÓбØÒª°ÑĬÈϵÄJSPÎļþ±à¼Æ÷¸Ä³ÉMyEclipse JSP Editor£¬·½±ãʹÓã¬Ò²¿ÉÒÔ½ÚÊ¡´ò¿ªÊ±¼ä.
>>Ð޸ķ½·¨>>£º
ÒÀ´Î´ò¿ªÈçϲ˵¥ºÍÑ¡Ï
Windows->Preferences->General->Editors->File Associations.
ÔÚÎļþ¹ØÁª¶Ô»°¿òÖУ¬¿ÉÒÔ¿´µ½File TypesÎļþÀàÐÍÁÐ±í£¬Ñ¡ÖÐ*.jsp£¬È»ºóÔÚÏÂÃæµÄAssociated EditorsÁбí¿òÖÐÑ¡ÖÐMyEclipse JSP Editor£¬×îºó£¬µ¥»÷ÓұߵÄdefault°´Å¥¾ÍÐÐÁË¡£
Õâʱ£¬Äã¿ÉÒÔ¿´µ½MyEclipse JSP Editor±»ÒƵ½Á˵ÚÒ»¸öλÖã¬×îºóµ¥»÷OK°´Å¥¾Í¿ÉÒÔʹÓÃMyEclipse JSP Editor´ò¿ªJSPÒ³ÃæÁË¡£
ÆäËûµÄÎļþĬÈϱà¼Æ÷Ð޸ķ½Ê½¸úÕâ¸ö²Ù×÷ÊÇÒ»ÑùµÄ£¬±ÈÈ磬ÄãÒ²¿ÉÒÔÐÞ¸ÄĬÈϵÄHTMLÎļþµÄĬÈÏ´ò¿ª±à¼Æ÷¡£
Ïà¹ØÎĵµ£º
jspÖÐÎÄÏÔʾÂÒÂë½â¾ö·½°¸
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
¶þ¡¢±íµ¥Ìá½»ÖÐÎÄʱ³öÏÖÂÒÂë
Èý¡¢Êý¾Ý¿âÁ¬½Ó
´ó¼ÒÔÚJSPµÄ¿ª·¢¹ý³ÌÖУ¬¾³£³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌ⣬¿ÉÄÜÒ»ÖÁÀ§ÈÅ×ÅÄú£¬ÎÒÏÖÔÚ°ÑÎÒÔÚJSP¿ª·¢ÖÐÓöµ½
µÄÖÐÎÄÂÒÂëµÄÎÊÌâ¼°½â¾ö°ì·¨Ð´³öÀ´¹©´ó¼Ò²Î¿¼¡£
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
ÏÂÃæµÄÏÔʾҳÃæ(display.jsp)¾Í³öÏÖÂÒÂ룺
< ......
<html:html>
<HEAD>
<tiles:insert attribute="header" />
</HEAD>
<body>
<tiles:insert attribute="top" />
<table width="100%" height="400" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td width="178" ......
//ѧϰ±Ê¼Ç, ¿ÉÄÜÓÐЩµØ·½Àí½âÓÐÎó, »á±í´ï²»Çå³þ
v512_servlet+jsp
01 ÔÚÐÞ¸ÄÍêCookieºó,Ò»¶¨Òª¼ÓÉÏresponse.addCookie(c);
CookieÖÐÖ»Äܱ£´æ×Öĸ»òÊý×ÖÐÅÏ¢;
02 req.getSession()Óëreq.getSession(boolean create)
ÎÞ²ÎÊýµÄ == ÓвÎÊýµÄ²ÎÊýÎ ......
JSPÔà»°¹ýÂËÆ÷µÄʵÏÖ
²»¹ÜÊÇJSP»¹ÊÇServlet£¬ÆäFilter¹ýÂËÆ÷¶¼ÊÇÒ»¸ö¶«Î÷¡£ÒòΪJSPµÄ±¾ÖʾÍÊÇServlet£¬Ö»²»¹ýÊDZ»°ü×°ÁËһϣ¬³ÉÁ˱ê×¼£¬ÈÃWeb·þÎñÆ÷¶¼×ñÑÕâ¸ö±ê×¼À´½âÎö±àÒëÖ´ÐжøÒÑ¡£
ÒÔÏÂÑÝʾµÄ¾ÍÊÇÔÚJSPÖÐÈçºÎ¹ýÂËÔà»°£¨ServletµÄ´¦Àí·½Ê½Ò²²î²»¶à£©¡£
Ò»¡¢¹ýÂËÆ÷Àà
package com.filter;
import java.io.Buffere ......
ͨ¹ýjsp(SUNÆóÒµ¼¶Ó¦ÓõÄÊ×Ñ¡)³ÌÐò»ñµÃdatabaseÀïµÄÊý¾Ý£¬È»ºóͨ¹ý³ÌÐò¿ØÖÆÆäÏÔʾ·½Ê½£¬ÕâÖÖ·½Ê½Ã÷ÏÔȱµãÊÇÈç¹ûÊý¾ÝÁ¿±È½Ï´óµÄʱºò»áÓÐÃ÷ÏÔµÄÐÔÄÜϽµ
ÏÖ½«²âÊÔ´úÂë·îÉÏ£¬¾¡¹ÜÎÒ¾¡Á¿ÏÞÖÆ´úÂëµÄ³¤¶È
ÏÈ˵Ï¿ª·¢²½Ö裻DB½Å±¾£¬²âÊÔ»ñµÃµÄÊý¾ÝÊÇ·ñÕýÈ·µÄÏÔʾÔÚÒ»¸ötableÖУ¬Ìí¼ÓÄÇ ......