Fórum

Link to message board with message id.

Roberto Fernandez Montero, modificado 11 Anos atrás.

Link to message board with message id.

New Member Postagens: 21 Data de Entrada: 12/12/12 Postagens Recentes
Hi, i am making portlet to show the last 10 topics in a category selected from message board.
I need to generate the URL to link this post in the JSP´S pages. I do it this:

/c/message_boards/find_message?p_l_id=HERETHEPLID&messageId=HERETHEID

And this genrate a url like this http://192.168.6.24:8080/c/message_boards/find_message?p_l_id=12987&messageId=3226107

How can i generate the correct url in JSP?
Thanks
thumbnail
srikanth arroju, modificado 11 Anos atrás.

RE: Link to message board with message id.

Regular Member Postagens: 133 Data de Entrada: 03/10/09 Postagens Recentes
MBMessageDisplay messageDisplay = (MBMessageDisplay)request.getAttribute(WebKeys.MESSAGE_BOARDS_MESSAGE);

MBMessage message = messageDisplay.getMessage();

MBCategory category = messageDisplay.getCategory();

MBThread thread = messageDisplay.getThread();


ortletURL portletURL = renderResponse.createRenderURL();

portletURL.setParameter("struts_action", "/message_boards/find_message");

portletURL.setParameter("messageId", String.valueOf(message.getMessageId()));
Roberto Fernandez Montero, modificado 11 Anos atrás.

RE: Link to message board with message id.

New Member Postagens: 21 Data de Entrada: 12/12/12 Postagens Recentes
This generate me a url like this:

http://localhost:8080/web/guest/home?p_p_id=VsfUltimosPosts_WAR_VsfUltimosPostsportlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=1&_VsfUltimosPosts_WAR_VsfUltimosPostsportlet_struts_action=%2Fmessage_boards%2Ffind_message&_VsfUltimosPosts_WAR_VsfUltimosPostsportlet_messageId=10601

I think the error is VsfUltimosPosts_WAR_VsfUltimosPostsportlet i need the war for the message_boards portlet.

Any idea?
Roberto Fernandez Montero, modificado 11 Anos atrás.

RE: Link to message board with message id.

New Member Postagens: 21 Data de Entrada: 12/12/12 Postagens Recentes
And with FriendlyUrlMapper its possible? Im watching the Wiki page in liferay.com but i dont understand completly.