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

JSP¹ýÂËÆ÷ȨÏÞ


½ñÌìÏÂÎ磬ÁÙÏ¿εÄʱºòÓиöѧÉúÎÊÁ˸ö¹ØÓÚ¹ýÂËÆ÷µÄʹÓõÄÎÊÌ⣬Ҳ²»ÖªµÀËý´Ó¸ãÏëµ½µÄ£¬¹À¼ÆÒ²ÊÇÍøÉÏÄÄλ´ïÈ˵ÄÑÝʾ£¬Ëý˵ԭÀ´ÄǸö¹¦ÄÜÓÐЩ¾ÖÏÞ£¬×Ô¼ºÀ©ÕÅÁËһϣ¬µ«ÀÏÊÇ´ï²»µ½Ð§¹û¡£ÓÚÊǾÍÀ´ÕÒÎÒÁË¡£
ËýµÄÐèÇóÈçÏ£º
1¡¢Ä¿±ê£ºÏÞÖƵǼÓû§µÄ·ÃÎÊÒ³Ã棬¸ù¾Ý²»Í¬µÄȨÏÞ¿ÉÒÔ²éѯÏàÓ¦µÄÒ³Ãæ¡£
2¡¢³¡¾°£ºÒÑÓÐÈý¸öÓû§admin¡¢normal1¡¢normal2£¬ÆäÖÐnormal1Ö»ÄÜ·ÃÎÊpage/jsp1ϵÄÒ³Ã棬normal2Ö»ÄÜ·ÃÎÊpage/jsp2ϵÄÒ³Ã棻
¸ù¾ÝËýµÄÃèÊö£¬ÎÒ´ò¿ªËýµÄ´úÂëÒ»¿´£¬Ò»¸ö×Ö“ÂÒ”£¬Á½¸ö×Ö“ºÜÂÒ”£¬ÍêÈ«¿´²»µ½ÈκÎÂß¼­ÔÚÀïÃ棬ÓÚÊÇƾמ­Ñé´óµ¶À«¸«µÄ¸øËüÀ´¸öÐÞÕý£¬ÐÞÕý´úÂëÈçÏ£º
Java´úÂë
if (session.getAttribute("user") != null) {   
    if(((UserInfo)session.getAttribute("user")).getName().equals("normal1") && !uri.startsWith("/page/jsp1")){   
        request.getRequestDispatcher("/page/jsp1/normal1.jsp").forward(request, response);   
    }   
    if(((UserInfo)session.getAttribute("user")).getName().equals("normal2") && !uri.startsWith("/page/jsp2")){   
        request.getRequestDispatcher("/MyJsp.jsp").forward(request, response);   
    }   
}else{   
    if(!(uri.endsWith("result.jsp") || !uri.endsWith("index.jsp"))){   
        request.getRequestDispatcher("/MyJsp.jsp").forward(request, response);   
    }   
}  
if (session.getAttribute("user") != null) {
if(((UserInfo)session.getAttribute("user")).getName().equals("normal1") && !uri.startsWith("/page/jsp1")){
request.getRequestDispatcher("/page/jsp1/normal1.jsp").forward(request, response);
}
if(((UserInfo)session.getAttribute("user")).getName().equals("normal2") &&am


Ïà¹ØÎĵµ£º

JSPÖÐ×Ô¶¨Òå±êÇ©ÊôÐÔÅäÖÃ˵Ã÷


required ÊÇÊÇ·ñΪ±ØÑ¡ÊôÐÔ
rtexprvalueµÄÈ«³ÆÊÇ Run-time Expression Value£¬ ËüÓÃÓÚ±íʾÊÇ·ñ¿ÉÒÔʹÓÃJSP±í´ïʽ.
µ±ÔÚ<attribute>±êÇ©ÀïÖ¸¶¨<rtexprvalue>true</rtexprvalue>ʱ£¬ ±íʾ¸Ã×Ô¶¨Òå±êÇ©µÄijÊôÐÔµÄÖµ¿ÉÒÔÖ±½ÓÖ¸¶¨»òÕßͨ¹ý¶¯Ì¬¼ÆËãÖ¸¶¨, example as follow:
<sql:query var="result" & ......

java web¿ª·¢ÖУ¬ÈçºÎ²é¿´JSPºÍServlet°æ±¾

java web¿ª·¢ÖУ¬ÈçºÎ²é¿´JSPºÍServlet°æ±¾
2008-12-10 09:00
ÎÒÃÇÔÚjava web¿ª·¢µÄ¹ý³ÌÖУ¬ÓÐʱÔÚ×ÊÁÏÉÏ¿ÉÄÜ»áÌáµ½»·¾³ËùÒªÖ§³ÖµÄJSP£¬Servlet°æ±¾¡£Èç¹û°æ±¾µÍ¾Í¿ÉÄܳöÏÖ²âÊÔ´íÎó¡£
·½·¨£º´ò¿ªtomcatµÄcommon\lib Ŀ¼Ï£¬ÓÐÁ½¸öJARÎļþ£º jsp-api.jar servlet-api.jar ¡£Èç¹ûûÓУ¬ÄÇ¿ÉÄÜÊÇÄãûÓÐÌí¼Ó½øÀ´¡£½âѹÕâÁ½¸ ......

xml£¬jsp,dtd,xsd ÌáʾÐÅÏ¢

½øÈëMyEclipse6.XÏÂ
Ð޸ģºeclipse.ini Îļþ
-Duser.language=en
¸Ä³É
-Duser.language=zh
µ¯³öÌáʾ£ºCtrl+"/"
dtd ÃüÃû¿Õ¼äµÄÌáʾÐÅÏ¢
window-->Preference-->xml-->XML Catalog-->add
Location :sql-map-2.dtd
key type :pubic ID
key:-//ibatis.apache.org//DTD SQL Map 2.0//EN (XMLÎļþÃüÃû¿Õ¼ ......

jsp servletÖеĹýÂËÆ÷FilterÅäÖÃ×ܽá


ÔÚJava web¿ª·¢Öг£»áʹÓõ½¹¦ÄÜÇ¿´óµÄ¹ýÂËÆ÷£¬Ëû±Ï¾¹ÄܸøÎÒÃÇ´øÀ´ºÜ´óµÄ·½±ã£¬µ«ÊÇÕë¶Ô¹ýÂ˵Ä×ÊÔ´ÎÒÃÇÐèÒªÏêϸµÄÁ˽âËûÃÇÔÚweb.xmlÖеÄÅäÖÃÐÅÏ¢¡£Õâ¸ö¸ù¾Ý¼¸ÖÖ³£ÓõIJ»Í¬Çé¿ö½øÐÐÁË×ܽ᣺
1¡£Èç¹ûÒªÓ³Éä¹ýÂËÓ¦ÓóÌÐòÖÐËùÓÐ×ÊÔ´£º
<filter>
<filter-name>loggerfilter</filter-name>
<f ......

jspÒ³ÃæÅжÏÊÇ·ñ°²×°²å¼þ


ÒÔÏÂΪÔÚjspÒ³ÃæjavascriptʵÏÖ·½Ê½£º
Èç¹ûÐèÒªÉèÖõØÖ·¹©Óû§ÏÂÔØʹÓÃ
1. ÐèÒªµ¼ÈëjspSmartUpload.jar°ü¡£
2. ÔÚÒ³ÃæÌí¼Ó<%@ page import=”com..jspsmart.upload.*”%>
function createOCX()
{
try
{
//´´½¨ActiveXobject¶ÔÏóʱ´«Èë²å¼þµÄVersionIndependProgID
//´Ë´¦ÅжÏϵͳÖÐÊÇ·ñ°²×°meid ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ