掲示板

How can I get default action URL?

9年前 に Daeyeop Kim によって更新されました。

How can I get default action URL?

New Member 投稿: 2 参加年月日: 15/03/12 最新の投稿
When I create a new portlet, there is <init-param> tag in portlet.xml :

<init-param>
<name>view-template</name>
<value>/jsp/view.jsp</value>
</init-param>

I want to call action about view.jsp.

Here is my code.

<aui:form action="/jsp/view.jsp" method="post">
<aui:input name="result" id="result" type="text"></aui:input>
<aui:button type="submit" value="Submit"/>
</aui:form>

but the action attribute is not exist, and it occur 404 not found.

Help me, Please.
thumbnail
9年前 に David H Nebinger によって更新されました。

RE: How can I get default action URL?

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
That's absolutely correct. You cannot just manufacture action urls the way you have for the form.

In reality all form submission goes to Liferay, so it's ROOT web app is looking for a /jsp/view.jsp file that doesn't exist there.

In order to do portlet development you have to discard your old ways of coding JSP. They will not work here.
9年前 に Daeyeop Kim によって更新されました。

RE: How can I get default action URL?

New Member 投稿: 2 参加年月日: 15/03/12 最新の投稿
Thanks for reply.

So should I code following example?

<portlet:actionURL var="editGreetingURL">
<portlet:param name="mvcPath" 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>

but I insert such as "/edit.jsp" in element value of <portlet:param>, it doesn't still working.