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
Ïà¹ØÎĵµ£º
required ÊÇÊÇ·ñΪ±ØÑ¡ÊôÐÔ
rtexprvalueµÄÈ«³ÆÊÇ Run-time Expression Value£¬ ËüÓÃÓÚ±íʾÊÇ·ñ¿ÉÒÔʹÓÃJSP±í´ïʽ.
µ±ÔÚ<attribute>±êÇ©ÀïÖ¸¶¨<rtexprvalue>true</rtexprvalue>ʱ£¬ ±íʾ¸Ã×Ô¶¨Òå±êÇ©µÄijÊôÐÔµÄÖµ¿ÉÒÔÖ±½ÓÖ¸¶¨»òÕßͨ¹ý¶¯Ì¬¼ÆËãÖ¸¶¨, example as follow:
<sql:query var="result" & ......
java web¿ª·¢ÖУ¬ÈçºÎ²é¿´JSPºÍServlet°æ±¾
2008-12-10 09:00
ÎÒÃÇÔÚjava web¿ª·¢µÄ¹ý³ÌÖУ¬ÓÐʱÔÚ×ÊÁÏÉÏ¿ÉÄÜ»áÌáµ½»·¾³ËùÒªÖ§³ÖµÄJSP£¬Servlet°æ±¾¡£Èç¹û°æ±¾µÍ¾Í¿ÉÄܳöÏÖ²âÊÔ´íÎó¡£
·½·¨£º´ò¿ªtomcatµÄcommon\lib Ŀ¼Ï£¬ÓÐÁ½¸öJARÎļþ£º jsp-api.jar servlet-api.jar ¡£Èç¹ûûÓУ¬ÄÇ¿ÉÄÜÊÇÄãûÓÐÌí¼Ó½øÀ´¡£½âѹÕâÁ½¸ ......
½øÈë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ÎļþÃüÃû¿Õ¼ ......
ÔÚJava web¿ª·¢Öг£»áʹÓõ½¹¦ÄÜÇ¿´óµÄ¹ýÂËÆ÷£¬Ëû±Ï¾¹ÄܸøÎÒÃÇ´øÀ´ºÜ´óµÄ·½±ã£¬µ«ÊÇÕë¶Ô¹ýÂ˵Ä×ÊÔ´ÎÒÃÇÐèÒªÏêϸµÄÁ˽âËûÃÇÔÚweb.xmlÖеÄÅäÖÃÐÅÏ¢¡£Õâ¸ö¸ù¾Ý¼¸ÖÖ³£ÓõIJ»Í¬Çé¿ö½øÐÐÁË×ܽ᣺
1¡£Èç¹ûÒªÓ³Éä¹ýÂËÓ¦ÓóÌÐòÖÐËùÓÐ×ÊÔ´£º
<filter>
<filter-name>loggerfilter</filter-name>
<f ......
ÒÔÏÂΪÔÚjspÒ³ÃæjavascriptʵÏÖ·½Ê½£º
Èç¹ûÐèÒªÉèÖõØÖ·¹©Óû§ÏÂÔØʹÓÃ
1. ÐèÒªµ¼ÈëjspSmartUpload.jar°ü¡£
2. ÔÚÒ³ÃæÌí¼Ó<%@ page import=”com..jspsmart.upload.*”%>
function createOCX()
{
try
{
//´´½¨ActiveXobject¶ÔÏóʱ´«Èë²å¼þµÄVersionIndependProgID
//´Ë´¦ÅжÏϵͳÖÐÊÇ·ñ°²×°meid ......