Topic
2 replies Latest Post - ‏2013-02-20T06:28:54Z by manishaneja
SystemAdmin
SystemAdmin
30897 Posts
ACCEPTED ANSWER

Pinned topic Struts - Portlet xml and struts config

‏2013-02-15T02:35:30Z |
Hi,

I am not able to understand following -

I have portlet.xml (The portlet deployment descriptor) which has all modes of portlet. There is one Custom portlet mode defined by this tag -
<custom-portlet-mode>
<portlet-mode>config</portlet-mode>
</custom-portlet-mode>

All this code is generated by RAD, the preferences are -
<preference>
<name>com.ibm.struts.portal.page.view.html</name>
<value>jsp/index.jsp</value>
</preference>
<preference>
<name>com.ibm.struts.portal.page.edit.html</name>
<value>jsp/edit_jsp.jsp</value>
</preference>

The Init pram for StrutsPortlet class are -

<init-param>
<name>config</name>
<value>/WEB-INF/struts-config.xml</value>
</init-param>
<init-param>
<name>config/html/edit</name>
<value>/WEB-INF/struts-html-edit.xml</value>
</init-param>

I have struts-html-edit.xml file and struts-config.xml under WEB-INF
My struts-html-edit.xml file has /edit action mapping and when i personalize/edit my portlet it goes to edit_jsp.jsp but it fails when it tries to locate /edit mapping and spits this error -

Caused by: javax.servlet.jsp.JspException: Cannot retrieve mapping for action /edit
at com.ibm.struts.taglib.html.FormTag.lookup(FormTag.java:470)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
at com.ibm._jsp._edit_5F_jsp._jspx_meth_html_form_0(_edit_5F_jsp.java:343)
at com.ibm._jsp._edit_5F_jsp._jspService(_edit_5F_jsp.java:163)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)

I dont understand when and how is struts-html-edit.xml is loaded and used/referred exactly by edit_jsp.jsp ... in fact this sturts-html-edit.xml file is not referred at all by my edit_jsp.jsp rather it looks under struts-config.xml
If i put the action mapping under struts-config.xml file, it just works

Can someone please explain me this ?

Thanks in Advance.
Updated on 2013-02-20T06:28:54Z at 2013-02-20T06:28:54Z by manishaneja
  • SystemAdmin
    SystemAdmin
    30897 Posts
    ACCEPTED ANSWER

    Re: Struts - Portlet xml and struts config

    ‏2013-02-16T05:49:03Z  in response to SystemAdmin
    Can anyone please help me in above ??
    At least any pointers ?
    • manishaneja
      manishaneja
      4 Posts
      ACCEPTED ANSWER

      Re: Struts - Portlet xml and struts config

      ‏2013-02-20T06:28:54Z  in response to SystemAdmin
      There are couple of SPF samples at Portal catalog and one of them is for using edit mode, you can refer those to validate if there's any variance in what sample has done and what you have tried. You may need to register before getting permission to download those samples.

      https://greenhouse.lotus.com/plugins/plugincatalog.nsf/assetDetails.xsp?action=editDocument&documentId=32C096AE75A8170385257811001D27FC