找了半天,可是没找到,看一个误导的,说设置成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,鉴于基本没有此类文章,这里记下,为为此而找不到原因的各位指路。
分享到:
相关推荐
使用pluto 利用struts2 来开发portlet,
pdf格式,本文从Liferay Portal的架构入手,详细讲解Portal的用户策略、内容布局、桌面和品质的要素,引导读者完成Liferay Portal初步的二次开发,在Liferay Portal上定制自己的Portlet。
一个处理支持Json数据处理的Portlet应用
IBM WPS IBM+Portlet+for+Google+Gadgets
简单的struts2+portlet2 Example 依赖已打包
Struts2 JSR168 Portlet的开发
包含IBM portlet api 帮助和PDF 中文教材
在weblogic下整合struts+spring+hibernate,实现struts portlet
通过liferay ide 和liferay sdk 6.1实现的插件形式的portlet 集成了liferay和struts2,适合初学者
liferay_使用struts2开发portlet
NULL 博文链接:https://yale.iteye.com/blog/487649
struts2.0官方项目之三(portlet) <br>=================================================== Struts2.0官方项目共4个,名字如下: <br>blank mailreader portlet showcase <br>这4个官方项目都...
开发webform表单,用插件开发poral
NULL 博文链接:https://soledede.iteye.com/blog/1956295
HelloWorld porlet that runs an external command (the example runs the Unix command ps). Compatible with GridSphere 3.1
websphere portlet