struts2+IBM portlet 首选项问题(edit_defaults)

找了半天,可是没找到,看一个误导的,说设置成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,鉴于基本没有此类文章,这里记下,为为此而找不到原因的各位指路。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值