Note that there are some explanatory texts on larger screens.

plurals
  1. PO"The requested resource was not found" When submitting a form in liferay portlet
    primarykey
    data
    text
    <p>I'm developing a liferay portlet. This is not my first time doing that, but a get a simple error that I can't understand why I'm getting this error. When I click submit button I get this error</p> <blockquote> <p>The requested resource was not found. "http://localhost:8081/addProduct" </p> </blockquote> <p>It's more than hours I'm trying to solve it and I know that I have made a silly mistake. Can any body help me solve this problem? Any help is appreciated in advance. Here is my jsp code:</p> <pre><code>&lt;%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %&gt; &lt;%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %&gt; &lt;%@ page import="javax.portlet.PortletURL" %&gt; &lt;portlet:defineObjects /&gt; This is the &lt;b&gt;ServiceBuilderTest&lt;/b&gt; portlet. &lt;portlet:actionURL var="addProduct" name="addProductAction"/&gt; &lt;aui:form method="post" action="addProduct"&gt; &lt;aui:fieldset&gt; &lt;aui:input name="productName" label="Product Name"&gt;&lt;/aui:input&gt; &lt;aui:input name="userID" label="User ID"&gt;&lt;/aui:input&gt; &lt;aui:input name="companyID" label="company ID"&gt;&lt;/aui:input&gt; &lt;aui:input name="groupID" label="Group ID"&gt;&lt;/aui:input&gt; &lt;aui:input name="serialNumber" label="Serial Number"&gt;&lt;/aui:input&gt; &lt;aui:button type="submit" value="Submit"&gt;&lt;/aui:button&gt; &lt;/aui:fieldset&gt; &lt;/aui:form&gt; </code></pre> <p>And this is my portlet class code:</p> <pre><code>public class ServiceBuilderPortlet extends MVCPortlet{ public void addProductAction(ActionRequest actionReauest, ActionResponse actionResponse) throws SystemException, PortalException { String productName = actionReauest.getParameter("productName"); String userID = actionReauest.getParameter("userID"); String companyID = actionReauest.getParameter("companyID"); String groupID = actionReauest.getParameter("groupID"); String serialNumber = actionReauest.getParameter("serialNumber"); PRProduct product = PRProductLocalServiceUtil.addProduct(Long.parseLong(companyID), Long.parseLong(groupID), productName, serialNumber, Long.parseLong(userID)); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload