Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8660763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:20:22+00:00 2026-06-12T16:20:22+00:00

I’m developing a liferay portlet. This is not my first time doing that, but

  • 0

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

The requested resource was not found. “http://localhost:8081/addProduct”

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:

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ page import="javax.portlet.PortletURL" %>

<portlet:defineObjects />

This is the <b>ServiceBuilderTest</b> portlet.
<portlet:actionURL var="addProduct" name="addProductAction"/>

<aui:form method="post" action="addProduct">
    <aui:fieldset>
        <aui:input name="productName" label="Product Name"></aui:input>
        <aui:input name="userID" label="User ID"></aui:input>
        <aui:input name="companyID" label="company ID"></aui:input>
        <aui:input name="groupID" label="Group ID"></aui:input>     
        <aui:input name="serialNumber" label="Serial Number"></aui:input>   
        <aui:button type="submit" value="Submit"></aui:button>  
    </aui:fieldset>
</aui:form>

And this is my portlet class 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));                  
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:20:23+00:00Added an answer on June 12, 2026 at 4:20 pm

    make it

    <portlet:actionURL var="addProduct" name="addProductAction"/>
    <aui:form method="post" action="<%=addProduct%>">
       ...
    

    actually, I’d see it as best practice to not name the action “addProductAction”, but just “addProduct”, so the changes would be as such (including one line of java, the rest looks good (visually, not tried/tested):

    <portlet:actionURL var="addProduct" name="addProduct"/>
    <aui:form method="post" action="<%=addProduct%>">
      ....
    

    and

    public class ServiceBuilderPortlet extends MVCPortlet{
       public void addProduct(ActionRequest request, ActionResponse response) throws SystemException, PortalException { 
           // ...
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.