Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Daniel Rodriguez
Calling struts actions
6 febbraio 2008 2.54
Risposta

Daniel Rodriguez

Punteggio: Junior Member

Messaggi: 38

Data di Iscrizione: 9 agosto 2006

Messaggi recenti

Hi everybody,

I'm including the message board comment system into the my own portlet and I'm having some problems with the struts action and I wonder if maybe you know how to help me.

I'm working over Eclipse Lomboz and I have my portlet as an independent project that I can export as .war file. Inside one of his JSP pages I need to call a struts action to include the comment system, so I added the path in a new struts-config.xml file I created for the portlet.
1<action-mappings>
2    <action path="/indicator/edit_indicator_discussion"
3                type="com.liferay.portlet.messageboards.action.EditDiscussionAction"
4                forward="/html/portlet/indicator/full_indicator.jsp" />
5</action-mappings>


Then, I use this struts action inside the JSP page.
1PortletURL disURL = renderResponse.createActionURL();
2disURL.setParameter("struts_action", "/indicator/edit_indicator_discussion");
3String discussionURL = disURL.toString();


So, this URL should call the struts action contained inside com.liferay.portlet.messageboards.action.EditDiscussionAction, but instead it calls the method contained in my indicator portlet class called processAction. I think I'm missing something that would make the portlet call the correct action instead of the default one provided by the portlet. I don't see anything I can configure inside web.xml, portlet.xml or liferay-portlet.xml.

Do you know any possible solution?

Thanks in advance.
Jorge Ferrer
RE: Calling struts actions
19 febbraio 2008 12.35
Risposta

Jorge Ferrer

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2768

Data di Iscrizione: 31 agosto 2006

Messaggi recenti

Hi Daniel,

If you want to use struts actions you have to use StrutsPortlet as the portlet controller.
Daniel Rodriguez
RE: Calling struts actions
27 febbraio 2008 0.41
Risposta

Daniel Rodriguez

Punteggio: Junior Member

Messaggi: 38

Data di Iscrizione: 9 agosto 2006

Messaggi recenti

Thanks!

I didn't realize that Eclipse Lomboz portlet is not struts portlet emoticon