找了半天,可是没找到,看一个误导的,说设置成portlet-mode=edit_defaults_compatibility
结果进到页面总说是portletmode为edit,真气死了。
后来又看说是用edit_defaults来,结果总说找不到action default。
直气到看源代码:
200: parseModeConfig(cfg, new PortletMode("config"), "configNamespace",
201: "defaultConfigAction");
202: parseModeConfig(cfg, new PortletMode("about"), "aboutNamespace",
203: "defaultAboutAction");
204: parseModeConfig(cfg, new PortletMode("print"), "printNamespace",
205: "defaultPrintAction");
206: parseModeConfig(cfg, new PortletMode("preview"), "previewNamespace",
207: "defaultPreviewAction");
208: parseModeConfig(cfg, new PortletMode("edit_defaults"),
209: "editDefaultsNamespace", "defaultEditDefaultsAction");
这里把edit_default全改成了editDefault,不然怎么找到呢,倒是说一声呀,不看到源码,这不是自己急死吗?
最后把这段好了的贴上
<portlet id="cm-bulletin-portlet">
<description xml:lang="EN">cm-bulletin-portlet</description>
<portlet-name>cm-bulletin-portlet</portlet-name>
<display-name xml:lang="EN">cm-bulletin-portlet</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<init-param>
<name>editNamespace</name>
<value>/edit</value>
</init-param>
<init-param>
<name>helpNamespace</name>
<value>/help</value>
</init-param>
<init-param>
<name>editDefaultsNamespace</name>
<value>/edit_defaults</value>
</init-param>
<init-param>
<name>defaultEditDefaultsAction</name>
<value>bulletin_showform_default</value>
</init-param>
<init-param>
<name>defaultViewAction</name>
<value>bulletin_view</value>
</init-param>
<init-param>
<name>defaultEditAction</name>
<value>bulletin_showform</value>
</init-param>
<init-param>
<name>defaultHelpAction</name>
<value>help</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
<portlet-mode>help</portlet-mode>
<portlet-mode>edit_defaults</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>cm-bulletin-portlet</title>
<short-title>cm-bulletin-portlet</short-title>
<keywords>cm-bulletin-portlet,ssh</keywords>
</portlet-info>
</portlet>
<custom-portlet-mode>
<portlet-mode>edit_defaults</portlet-mode>
</custom-portlet-mode>
当然,还要改struts.xml,鉴于基本没有此类文章,这里记下,为为此而找不到原因的各位指路。