Note that there are some explanatory texts on larger screens.

plurals
  1. PO<portlet:actionURL> unable to go action page in liferay
    primarykey
    data
    text
    <p>I am developing a liferay portlet I just called an action function from view.jsp page. I already implemented this code in my previous portlets but now I don't know why it is not working code of the portlet is in view.jsp </p> <pre><code> &lt;%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %&gt; &lt;portlet:defineObjects /&gt; &lt;portlet:actionURL var="insert" name="interlope"&gt;&lt;/portlet:actionURL&gt; &lt;script type="text/javascript" charset="utf-8"&gt; function embedFun() { try { alert(insert.toString()); document.getElementById('insertpart').action='&lt;%=insert.toString()%&gt;'; document.getElementById('insertpart').submit(); } catch(err) { alert("embedfun of shop_search view.jsp: "+err); } } &lt;/script&gt; and my action class is package com.shop.search; import java.io.IOException; import java.rmi.RemoteException; import java.sql.Date; import java.util.List; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletException; import javax.portlet.ProcessAction; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import javax.portlet.ResourceRequest; import javax.portlet.ResourceResponse; import shop.search.item.model.Cart; import shop.search.item.model.Item; import shop.search.item.model.available; import shop.search.item.model.impl.CartImpl; import shop.search.item.service.CartLocalServiceUtil; import shop.search.item.service.ItemLocalServiceUtil; import shop.search.item.service.availableLocalServiceUtil; import com.liferay.compat.portal.util.PortalUtil; import com.liferay.counter.service.CounterLocalServiceUtil; import com.liferay.portal.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.model.PortletPreferences; import com.liferay.portal.model.User; import com.liferay.portal.theme.ThemeDisplay; import com.liferay.util.bridges.mvc.MVCPortlet; /** * Portlet implementation class Shop_SearchPortlet */ public class Shop_SearchPortlet extends MVCPortlet { @ProcessAction(name="interlope") public void interlope(ActionRequest req, ActionResponse res) throws PortletException, SystemException, RemoteException { String searchVal=req.getParameter("inputText"); List&lt;Item&gt; tbl=null; if(searchVal!=null) { tbl=ItemLocalServiceUtil.findItemByBrand(searchVal); if(tbl!=null) { req.setAttribute("tblval",tbl); System.out.println("@@@@@@@@@@@@ val of obj: "+tbl); enter code here } else System.out.println("@@@@@@@@ val of tbl obj: "+tbl); } }} ` //redirect to insert action class { try { alert(insert.toString()); document.getElementById('insertpart').action='&lt;%=insert.toString()%&gt;'; document.getElementById('insertpart').submit(); } catch(err) { alert("embedfun of shop_search view.jsp: "+err); } } &lt;/script&gt; &lt;form method="post" id="insertpart"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;input type="text" id="inputText" name="inputText"&gt; &lt;input type="button" value="search" name="submitbutton" onclick="embedFun();"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;/tabale&gt; </code></pre> <p>If you notice in my code I added try and catch block in javascript code to what is the value of insert and I got that there is no value in insert means no url coming in insert in no syntax problem nothing but out put is not coming please help me. I already completed another same as this one that was working fine. Because of some issue I have changed my workspace is this may be the cause, even I ask my friend about this issue he told no relation with change of workspace to create some problem in code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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