---
title: "Struts target is null for setProperty(null, \"x\", [Ljava.lang.String;@179da9f)"
author: "phosphory"
date: "2011-01-14T09:44:54Z"
tags: []
categories: ["企业架构"]
slug: "struts-target-is-null-for-setproperty-null-x-ljava-lang-string-179da9f"
draft: false
lastmod: "2011-01-14T09:44:54Z"
id: 870926
url: "https://phosphory.iteye.com/blog/870926"
---

### [Struts target is null for setProperty(null, "x", \[Ljava.lang.String;@179da9f)](http://cmm.iteye.com/blog/491723)

近来用Struts2开发的时候经常会遇见这样的错误信息，虽然很多时候都不影响开发过程。

 

主要原因是因为Struts2 的Action类中没有相关属性。如果x是aaa.yyy之类的，那么首先要考虑Action中有没有aaa属性类，如果有，则考虑aaa对象是否有yyy属性。如果x仅仅是aaa的话，那么就在action类中寻找看看是否有aaa属性。满足这种条件的话，则是不会出现上述问题的。