---
title: "eclipse中的get/set功能的一个bug"
author: "mousepc"
date: "2012-03-08T15:16:02Z"
tags: []
categories: ["编程语言"]
slug: "eclipse-get-set-bug"
draft: false
lastmod: "2012-03-08T15:16:02Z"
id: 1446525
url: "https://mousepc.iteye.com/blog/1446525"
---

今天发现一个问题，页面中的值一部分不能传到后台(用的struts2+hibernate+spring)，没发现哪里有写错，看了一下POJO，原来是eclipse的bug。

 

```
当属性中第二个字母是大写的时候，使用eclipse的generater set/get功能的时候
会这样，get,set方法后的p是小写，而不是大写。
所以使用struts没办法从页面到后台传值。
```

 

 

 

```
//当属性中第二个字母是大写的时候，使用eclipse的generater set/get功能的时候
//会这样，get,set方法后的p是小写，而不是大写。
//所以使用struts没办法从页面到后台传值。
private Date pStartDatePWSC;

public Date getpStartDatePWSC() {
	return pStartDatePWSC;
}

public void setpStartDatePWSC(Date pStartDatePWSC) {
	this.pStartDatePWSC = pStartDatePWSC;
}
```