freemarkerÈçºÎÒýÈëcssÎļþ - Java / Java EE
Ä£°åºÍcssÎļþ²»ÔÚͬһĿ¼Ï£¬ÈçºÎ»ñÈ¡ÏîÄ¿µÄ¸ùĿ¼
ÏÈÕÒµ½µ±Ç°½çÃæµÄÉÏÒ»¼¶Ä¿Â¼
"../css.css" £ºÆäÖС°../¡±Ö¸µ±Ç°Ä¿Â¼µÄÉϼ¶Ä¿Â¼,ÆäÖÐCSSÎļþΪÉÏÉϼ¶Ä¿Â¼ÖÐÎļþ
ÕÒµ½ÆäËûĿ¼ÒÔ´ËÀàÍÆ
ÎÒÒ²ÖªµÀÕâÑùµÄ°ì·¨£¬¿ÉÊǾõµÃ²»·½±ã£¬ÏëÖªµÀÔõô»ñÈ¡¸ùĿ¼£¬¿´µ½ÍøÉÏÓÐ˵ÓÃ{base}¿ÉÊǺÃÏñûÓÐÓõÄ
Õâ¸ö{base}ÊÇÄãÔÙÄ£ÐÍÖж¨ÒåµÄ£¬Äãû¶¨Ò嵱Ȼ²»¿ÉÓÃÁË°¡£¬¼ÙÉèÄãÔÙfreemarkerÄ£ÐÍÖж¨ÒåÁËÒ»¸ö±äÁ¿½Ð base£¬Õâ¸öbaseÊÇ, request.getContextPath()£¬ÆäÖÐrequest.getContextPath()ÊÇÄãÏîÄ¿µÄ¸ùĿ¼£¬;
ÄÇôÄúµÄÔÚftlÎļþÖÐÒýÓÃcss¾Í¿ÉÒÔͨ¹ý
<link rel="stylesheet" href="${base}/css/ÄúµÄ.css">
ÕâÀïbaseÊÇÄúµÄÏîÄ¿¸ùĿ¼£¬cssÊÇÏîÄ¿¸ùĿ¼ÏµÄcssÎļþ¼Ð¡£
Õâ¸ö¾ÍÊÇÄãµÄ¸ùĿ¼:request.getContextPath()/λÖà ¾ÍµÃµ½ÏàÓ¦µÄÎļþ¡£
Ïà¹ØÎÊ´ð£º
¸÷·´óÏÀ¸ø¸ö˼·£¬²»ÊÇÔÚÏßµÄÄÇÖÖ£¬¾ÍÊÇÒ»¸ö×öÆÕͨµÄÓ¦ÓóÌÐò¡£
´Ê¿âÔõôÉú³ÉÄØ£¿
²»»á¡£
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
ÕÒ±¾×Öµä
ÒýÓÃ
´Ê¿âÔõôÉú³ÉÄØ£¿
Êý¾Ý¿â ºÇºÇ
ÓÃmap ¼üÖµ¶ÔÓ¦
Èç¹ûÓÃÊý¾Ý¿ ......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
tableÔõô°ó¶¨Êý¾Ý¿â£¬²¢ÇÒÓÃJavaScriptʵÏÖ·Ò³¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£JavaScriptÄÜÏòJSPÒ³Ãæ´«µÝ²ÎÊýÂð
Äã˵µÄÎÊÌâÓеãÄǸö¡£¡££¬²»ºÃ»Ø´ð¡£¡£¡£¡£
jspÖÐtableÊÇÐèÒªhtml´úÂëÓëÒ³Ãæ¶Ë»ñÈ¡Êý¾Ý¿â²éѯºóµÄÐÅÏ¢½øÐÐ ......
ÓÐËÓÃjava×ö¹ý´òÓ¡·¢Æ±µÄ³ÌÐò£¬¸Ð¾õÕâ·½Ãæ²»ÊǺܺÿØÖÆ£¬Ï£Íû¸øµã½¨Ò飬×îºÃÄܸø³ö´úÂë
¼òµ¥µã¾Íµ÷ÓÃwindow.print()
ÄãÒ²¿ÉÒÔ°ÑÏÂÃæ´úÂë·Åµ½ÄãJSPÖÐ:
<html>
<head>
<title> ......
ÇëÎʸ÷λ¸ç¸ç½ã½ã£¬ÈçºÎÔËÓÃÏֳɵÄÄ£°åÀ´ÖÆ×÷ƯÁÁµÄJSPÍøҳѽ,»ØÕßÓзÖ!
×Ô¼º¶¥Ï£¬×ÜÓиßÊÖ°É,ÆÚ´ýÖÐ......
Èç¹ûÖ±½ÓÒýÓýøÈ¥
¿ÉÒÔÖ±½ÓÓÃjspµÄÖ¸ÁҲ¿ÉÒÔÓÃfreemarkÒýÓ㬼ǵøø·Ö
лл¸÷λÁË£¬¿´À´Î ......