Foros de discusión

Liferay in Action (Richard Sezov, Jr.): Hello World - missing namespace?

Jiri P., modificado hace 10 años.

Liferay in Action (Richard Sezov, Jr.): Hello World - missing namespace?

New Member Mensajes: 9 Fecha de incorporación: 2/12/13 Mensajes recientes
Hello,

at the beginning, many thanks to Richard for his really amazing and breathtaking book (Liferay in Action) - I am almost at the end ;-)
Since the most of the book was quite clear to me, I did not spend time to code the examples listed inside by myself, I rather focused on the technology itself while reading.

Now I have some time to dig into the code a little bit, but unfortunatelly I was stopped almost at the beginning - talking about Hello World Portlet. It took me some time to find a solution, but to be sure, I am interested whether I didn't miss stg.

Following the Hello World Portlet line by line I found that I am absolutely not able to get the "username" parameter from "edit.jsp" into the "processAction" method.
Here is the code from the book (the same as included in some updated and also original code bundle for this book)

<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<jsp:usebean class="java.lang.String" id="addNameURL" scope="request" />
<portlet:defineobjects />

<form id="<portlet:namespace />form" action="<%= addNameURL %>" method="post">
	<table>
		<tbody><tr>
			<td>Name:</td>
			<td><input type="text" name="username"></td>
		</tr>
	</tbody></table>
	<input type="submit" id="nameButton" title="Add Name" value="Add Name">
</form>


I found that if you do not specify "<portlet:namespace />" also for username input (name="<portlet:namespace />username"), this parameter will never appear on the side of Portlet class ("processAction" method).

I am currently using the newest Liferay Portal Community Edition 6.2.0 CE GA1 (Newton / Build 6200 / November 1, 2013).
What I do not understand is if something changed comparing v6.0(1) with the latest version, that the parameters did not have to have namespace specified and now the namespace must be there or did I missed something?

Thanks a lot!
Jiri
thumbnail
Jignesh Vachhani, modificado hace 10 años.

RE: Liferay in Action (Richard Sezov, Jr.): Hello World - missing namespace

Liferay Master Mensajes: 803 Fecha de incorporación: 10/03/08 Mensajes recientes
Hi Jiri,

I am sure Liferay suggests to use AllyUI framework to create form and fields which has a capability to add namespace automatically for each fields.
so if you create a fields using AlloyUI then you don't need to bother about it.

Regards,
Jignesh
Jiri P., modificado hace 10 años.

RE: Liferay in Action (Richard Sezov, Jr.): Hello World - missing namespace

New Member Mensajes: 9 Fecha de incorporación: 2/12/13 Mensajes recientes
Hello,

yes, this absolutely makes sense, why to use AlloyUI framework instead.
But for me it was important to understand that stg is missing there or that there was no need to add namespace manually to each fields in previous versions of Liferay (for instance that the namespace is inherited from the form or stg like this).

Thanks,
Jiri
thumbnail
Juan Gonzalez, modificado hace 10 años.

RE: Liferay in Action (Richard Sezov, Jr.): Hello World - missing namespace

Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Hi Jiri,

yes, you are right. The mandatory namespacing was implemented for 6.2, but a config param was introduced afterwards for disabling in any portlet:

https://github.com/liferay/liferay-portal/blob/6.2.0-ga1/definitions/liferay-portlet-app_6_2_0.dtd#L652-L655

here is the LPS

https://issues.liferay.com/browse/LPS-37706
Jiri P., modificado hace 10 años.

RE: Liferay in Action (Richard Sezov, Jr.): Hello World - missing namespace

New Member Mensajes: 9 Fecha de incorporación: 2/12/13 Mensajes recientes
Hi Juan,

thank you very much for explanation!

Best regards,
Jiri