如果JSP页面出现异常,就会转到tomcat自动的那个异常页面,页面不怎么友好。jsp标准中提供了error page的配置,可以自己定义当出现错误时跳转到哪个页面。这个配置在web.xml里面进行配置,下面一步步来实现自定义错误页面。
1.首先,在web.xml加入下面的标签:
<error-page>
<error-code>400</error-code>
<location>/400.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
1.首先,在web.xml加入下面的标签:
<error-page>
<error-code>400</error-code>
<location>/400.html</location>
</error-page>
<error-page>
<error-code>404</error-code>
以下代码放在footer页
<!--动画一-->
<SPAN class=spanclass id=span_ad_01>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="461" height="187">
<param name="movie" value="flash/2.swf" />
<param name="quality" value="high" />
<embed src="flash/2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="461" height="187"></embed>
</object>
</SPAN>
<!--动画一-->
<SPAN class=spanclass id=span_ad_01>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="461" height="187">
<param name="movie" value="flash/2.swf" />
<param name="quality" value="high" />
<embed src="flash/2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="461" height="187"></embed>
</object>
</SPAN>