我在 portlet 首选项中遇到了一个问题,我无法更改 portlet 首选项值,即首选项值没有改变。
我已经更改了 portlet 中的值,然后在已更改的portlet.xml
地方交叉签入。但是,当我尝试使用它的键获取这个 portlet 首选项值时,它总是给我较早的值。
我的 portlet.xml 看起来像这样:
<portlet-preferences>
<preference>
<name>DATA_FILE_DOC_NAME</name>// the name of the preference
<value>COM-EXAMPLE-EDIT</value>// the corresponding value
<read-only>false</read-only>// extra attribute
</preference>
</portlet-preferences>
在 Java 文件中,我正在检索此首选项,如下所示:
....
//Getting the portal prefernce object.
PortletPreferences portletPreference = portletRequest.getPreferences();
// get the data file doc name.
dataFileDocName = portletPreference.getValue(
"DATA_FILE_DOC_NAME", "Not Found!!");
System.out.println("Data file doc name is : "+dataFileDocName.toUpperCase());
我得到dataFileDocName
了COM-EXAMPLE-EDIT但如果我将偏好更改为其他内容,我仍然会得到相同的偏好COM-EXAMPLE-EDIT(无论我清理和发布我的项目多少次)。
请帮帮我。