---
title: "web配置文件中convertNull要注意的地方"
author: "mjbb"
date: "2010-03-18T20:57:33Z"
tags: []
categories: ["编程语言"]
slug: "web-convertnull"
draft: false
lastmod: "2010-03-18T20:57:33Z"
id: 619375
url: "https://mjbb.iteye.com/blog/619375"
---

1.在web.xml中，<load-on-startup>0</load-on-startup>中数字越小说明越早加载
2.在<servlet>下的
		
```xml
<init-param>
			<param-name>convertNull</param-name>
			<param-value>true</param-value>
		</init-param>
```

这里的convertNull=true说明：加载servlet的时候，
将把以前的加载过的所有的转换器设置输出默认值改为Null，而不是自己本身传过来参数的默认值：
如：当一个Long id;变量传到servlet的时候，如果没有设置<span style="color:red">convertNull=TRUE的设置的</span>话
它默认经过<span style="color:red">转换器转换成：0</span>，但是设置convertNull=TRUE的设置的话，id就等于null了