这个问题困扰了一阵子,现在总算有办法解决这个google sitemap 404问题了。可以一直保持验证通过,又可以方便的定义自己的404页面或者重定向到别的页面(如首页)
不过,在验证自己的网站的时候,经常会遇到这样的错误:
我们检测到您的 404(找不到文件)错误页面在响应标头中返回状态代码 200 (OK)
这个错误的原因是: 此WEB服务器的404错误的返回值不提供404的错误代码,而是使用的200(OK)的代码.
想测试一下自己的WEB服务器是否返回404,可以在这个页面测试: http://gsitecrawler.com/tools/Server-Status.aspx ,在URL to check:这个输入框输入一个自己的网站上不存在的路径,像我的网站就是: http://blog.renmai.cn/xxx.xx ,点击Check server response codes按钮,正常情况下面,返回值应该如下:
引用内容
不过,在验证自己的网站的时候,经常会遇到这样的错误:
我们检测到您的 404(找不到文件)错误页面在响应标头中返回状态代码 200 (OK)
这个错误的原因是: 此WEB服务器的404错误的返回值不提供404的错误代码,而是使用的200(OK)的代码.
想测试一下自己的WEB服务器是否返回404,可以在这个页面测试: http://gsitecrawler.com/tools/Server-Status.aspx ,在URL to check:这个输入框输入一个自己的网站上不存在的路径,像我的网站就是: http://blog.renmai.cn/xxx.xx ,点击Check server response codes按钮,正常情况下面,返回值应该如下:

Results of the GSiteCrawler Server-Test
Tags: 404
用Hibernate自带的连接池性能不太高,而且还存在BUG。因此官方推荐使用c3p0或Proxool连接池。
这里我介绍Hibernate使用Proxool连接池的配置:
首先配置Proxool的配置文件,文件名:Proxool.xml(当然,你也可以用资源文件)
这里我介绍Hibernate使用Proxool连接池的配置:
首先配置Proxool的配置文件,文件名:Proxool.xml(当然,你也可以用资源文件)
复制内容到剪贴板
程序代码

<?xml version="1.0" encoding="UTF-8"?>
<!-- the proxool configuration can be embedded within your own application's.
Anything outside the "proxool" tag is ignored. -->
<something-else-entirely>
<!-- the proxool configuration can be embedded within your own application's.
Anything outside the "proxool" tag is ignored. -->
<something-else-entirely>
Tags: Proxool
前段时间刚完成一个家教网项目,数据库为MySQL5.0,持久层使用Hibernate 3.1,没有使用额外的连接池,那么Hibernate会默认使用它自带的一个默认连接池,也就是DriverManagerConnectionProvider。
先在本机上调试都毫无问题,于是部署到服务器上,也都没什么问题。由于这是新网站,根本还没正式对外发布和宣传,所以头两天根本没人访问。等到第二天,我再次访问网站时,问题就出现了,错误信息如下:
引用内容
先在本机上调试都毫无问题,于是部署到服务器上,也都没什么问题。由于这是新网站,根本还没正式对外发布和宣传,所以头两天根本没人访问。等到第二天,我再次访问网站时,问题就出现了,错误信息如下:

root cause
javax.servlet.ServletException: org.hibernate.exception.JDBCConnectionException: could not execute query
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
javax.servlet.ServletException: org.hibernate.exception.JDBCConnectionException: could not execute query
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
复制内容到剪贴板
程序代码

<script>
function openpopup(){
window.open("http://www.xxx.com/","","width=300,height=300,scroolbars=no") //自己修改弹出窗口
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
function openpopup(){
window.open("http://www.xxx.com/","","width=300,height=300,scroolbars=no") //自己修改弹出窗口
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
Tags: Cookie