掲示板

Creating My Greeting portlet tutorial doesn't work.

thumbnail
13年前 に Cameron McBride によって更新されました。

Creating My Greeting portlet tutorial doesn't work.

Expert 投稿: 269 参加年月日: 11/02/08 最新の投稿
I am following through the My Greeting portlet tutorial found here: http://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/writing-the-my-greeting-portlet

What I have found is that the actionRequest variable is null in the edit.jsp file. Since that variable is null the purpose of the whole thing fails.

Just to be sure in both the edit.jsp and the view.jsp I added this up near the top:
if (actionRequest == null) { System.out.println("actionRequest is null"); }

Has something changed since the documentation was written?
13年前 に Oliver Bayer によって更新されました。

RE: Creating My Greeting portlet tutorial doesn't work.

Liferay Master 投稿: 894 参加年月日: 09/02/18 最新の投稿
Hi Cameron,

as Deb Troxel mentioned in the Developer Documentation Review it should be "renderRequest" instead of "actionRequest".

See the following link.

HTH Oli
thumbnail
13年前 に Cameron McBride によって更新されました。

RE: Creating My Greeting portlet tutorial doesn't work.

Expert 投稿: 269 参加年月日: 11/02/08 最新の投稿
Thanks for that link.

Another bug/problem in the tutorial is with the success message. When you click submit it is supposed to show the edit.jsp page again with a success message. Instead it executes the action MyGreetingPortlet.java and then shows view.jsp.

<portlet:actionurl var="editGreetingURL" name="setGreeting">
	<portlet:param name="jspPage" value="/edit.jsp" />
</portlet:actionurl>

<aui:form action="<%= editGreetingURL %>" method="post">
	<aui:input label="greeting" name="greeting" type="text" value="<%= greeting %>" />
	<aui:button type="submit" />
</aui:form>


Snippet from my portal.xml:
		<portlet-class>com.liferay.samples.MyGreetingPortlet</portlet-class>
		<init-param>
			<name>view-jsp</name>
			<value>/view.jsp</value>
		</init-param>


I don't understand why after submitting the form the view.jsp is shown instead of edit.jsp.
12年前 に Hon Hwang によって更新されました。

RE: Creating My Greeting portlet tutorial doesn't work.

New Member 投稿: 17 参加年月日: 11/07/04 最新の投稿
Hi,

See this thread. for details. Basically, in portlet.xml, you'll have to add this:

<init-param>
    <name>copy-request-parameters</name>
    <value>true</value>
</init-param>


even though, it is listed as a tip in the developer documentation. I encountered the same problem.

I still have no idea why this worked at the moment; searching for answers.
11年前 に Nguyen Le によって更新されました。

RE: Creating My Greeting portlet tutorial doesn't work.

New Member 投稿: 11 参加年月日: 12/04/24 最新の投稿
GreetingPortlet is temporarily unavailable.

Help me, please