找到原因了,跟继承不继承File无关,只要重写NodeTest的toString方法就行了,如果不重写,它会使用Object基类的toString方法,返回类似于com.test.tapestry.global.TableNode@c1b531之类的字串,我想大概跟这个有关吧,File重写了toString方法,所以继承于File就继承了其toString方法,就不会出错。在网站上也搜到一些相关的东西,其中有这样一段话,虽不是很明白,但觉得似乎跟这个有关,先放在这里,供大家参考。
It appears that the reason is that the interceptor tries to add all request parameters to the ognl stack. Some of these parameters are "reserved" for the webwork portlet framework, such as webwork.portlet.mode, webwork.portlet.eventAction and so on. When adding these keys to the stack, it splits the dotted notation into a "path" to a property, which of course does not exist.