jspÖеÄinclude¾²Ì¬Ò³Ãæ³öÏÖÂÒÂëÎÊÌâ
ÔÚµ±Ç°Ó¦ÓÃϵͳµÄweb.xmlÀï¼ÓÈëjsp-config´úÂ룺
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<jsp-config>
<jsp-property-group>
<description>
Special property group for JSP Configuration JSP example.
</description>
<display-name>JSPConfiguration</display-name>
<url-pattern>*.jsp</url-pattern>
<el-ignored>true</el-ignored>
<page-encoding>GB2312</page-encoding>
<scripting-invalid>false</scripting-invalid>
<include-prelude></include-prelude>
<include-coda></include-coda>
<description>
Special property group for JSP Configuration JSP example.
</description>
<display-name>JSPConfiguration</display-name>
<url-pattern>*.html</url-pattern>
<el-ignored>true</el-ignored>
<page-encoding>GB2312</page-encoding>
<scripting-invalid>false</scripting-invalid>
<include-prelude></include-prelude>
<include-coda></include-coda>
</jsp-property-group>
</jsp-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
... ...
</webapp>
˵Ã÷£º<jsp-config>ÀïµÄ¶¨Ò壬¾ÍÊÇ֪ͨµ±Ç°Ó¦Ó÷þÎñÆ÷£¬µ±Ç°Ó¦ÓÃϵͳÏ£¬ËùÓÐµÄ .jsp, .html Îļþ£¬ÈôÊÇûÓж¨ÒåcontentType="text/html;charset=gb2312" ʱ£¬¾Í»á²ÉÓÃÔ¤ÉèµÄ "GB2312" ×Ö·û¼¯È¥´¦Àí£¬Èç´Ë£¬¾Í²»ÐëÒªÔÚÿ¸ö include µÄµµ°¸µÚÒ»ÐмÓÉÏ contentType="text/html;charset=gb2312" ÁË¡£
Ïà¹ØÎĵµ£º
tomcat6.0 + JSP + mysqlÊý¾Ý¿âÁ¬½Ó³ØÅäÖÃ
»·¾³£ºtomcat6.0 £¬mySQL 5.021
°ÑmysqlÇý¶¯°ü·Ö±ð·Åµ½%TOMCAT_HOME%/lib ºÍÄãµÄÓ¦ÓõÄWEB-INF\libÎļþ¼ÐÏÂÃæ
1¡¢ÐÞ¸Ä%TOMCAT_HOME%/conf/server.xml,Ìí¼ÓÈçÏÂÄÚÈÝ£¨²¿·Ö²ÎÊýÇë±¾µØ»¯£©£º
<Context path="/web" docBase="web" ......
ÎÒ¸Õѧjsp£¬ÕÒÁËÒ»¸öÍøÕ¾ÏëÅäÖúû·¾³£¬È»ºó¸Ä¸Ä£¬¿ÉÊÇÓöµ½Ò»¸öÎÊÌ⣬²»¶®Ôõô½â¾ö¡£Çë´ó¼Ò°ï°ïÎÒ£¡
ÎÊÌâÈçÏ£ºÎÒ×°µÄ»·¾³ÊÇ£ºeclipse+MyEclipse5.5+sql2000+tomcat5.5ÔËÐкó³öÏÖ£º
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this r ......
¹Ø¼ü×Ö: jsp´«µÝÖÐÎIJÎÊý¡¢¿Õ¸ñÒÔ¼°±íµ¥ÄÚÈÝ»»ÐÐÎÊÌâ½â¾öС½á
ÔÚÀàËÆÁôÑÔ°åµÄwebÓ¦ÓÃÖУ¬ÐèÒª½«<textarea>ÖеĴó¶ÎÎÄ×ÖÏÔʾÔÚJspÒ³ÃæÉÏ£¬Òò´ËÐèÒª¶ÔÎÄ×ÖÖеÄÌØÊâ×Ö·ûÈç»»ÐС¢¿Õ¸ñµÄ×÷´¦Àí£¬·½·¨ÈçÏ£º
1¡¢Ö±½Ó±£´æ£¬È»ºóµ±´ÓÊý¾Ý¿âÖÐÈ¡³öÀ´Ê±ÓùýÂË·½·¨¹ýÂËÒ»±éÔÙËÍ»ØÒ³Ãæ¼´¿É£¬¸øÒ ......
ÔÚ¸÷ÖÖÍøÒ³ÖÆ×÷¼¼ÊõÂÛ̳ÖУ¬³£³£ÓÐÈËѯÎÊjavascriptÓëJavaÓÐʲôÇø±ð£¬ÉõÖÁÓÐÈËÎóÈÏΪjavascript¾ÍÊÇJava¡£javascriptÓëJavaȷʵÓÐÒ»¶¨µÄÁªÏµ£¬µ«ËüÃDz¢²»ÏñÎÒÃÇÏëÏóµÄÄÇÑùÁªÏµ½ôÃÜ£¬ÉõÖÁ¿ÉÒԿ϶¨µØ˵ËüÃÇÓкܴóµÄÇø±ð¡£
¡¡¡¡Ê²Ã´ÊÇJavaScript £¿
¡¡¡¡JavaScript ÊÇ¶Ô ECMA 262 Ó ......
//ÏÂÃ棬´ÓÇëÇóÖеõ½ÊôÐÔ ÎªÒ»¸ö À࣬£¬»áÅжÏÊÇ·ñΪnull£¬£¬ÈçΪnullÔòʵÀý»¯
// id Öµ Ï൱ÓÚ class µÄ ¶ÔÏóÃû
<jsp:useBean id="order" class="com.entity.Order" scope="request" />
<==>
<%
Order order=(Order)request.getAttribute("order");
if(order==null)
  ......