逛奔的蜗牛

我不聪明,但我会很努力

   ::  :: 新随笔 ::  ::  :: 管理 ::

在web.xml中加入以下内容即可:

    <error-page>

        <error-code>404</error-code>

        <location>/404.html</location>

    </error-page>


====================================== 404.html ======================================

<!DOCTYPE html>

<html>

<title>Nothing found</title>

<style type="text/css">

img {

position: absolute;

left: 50%;

top: 50%;

margin-left: -200px;

margin-top: -209px;

}

</style>

<body>

    <img src="images/404.jpg" />

</body>

</html>

posted on 2010-12-27 01:21 逛奔的蜗牛 阅读(2508) 评论(1)  编辑 收藏 引用 所属分类: Java

评论

# re: Java:Web工程中设置404页面[未登录] 2015-12-11 13:35 12
123  回复  更多评论
  


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理