How can I call the action method inside the MVCPortlet class onclick of the Submit button

女生的网名这么多〃 提交于 2019-12-02 12:45:10

For your jsp you're close. Needs a bit of reordering, using the actionURL and the portlet's namespace. Warning - typed in stackoverflow answer window, didn't actually compile/run:

<liferay-portlet:actionURL name="registerUser" var="registerUserURL"></liferay-portlet:actionURL>
<form action="<%=registerUserURL%>">
    <div>
        <input class="default-value" type="text" name="<portlet:namespace/>Name" value="Name" />
        <input class="default-value" type="text" name="<portlet:namespace/>Password" value="Password" />
    </div>
</form>

<div class="fieldgroup">
 <input type="submit" value="Register" class="submit">
</div>

As you extend Liferay's MVC portlet the portlet side looks ok - just use request.getParameter("Name"); there.

This is not related to jQuery at all, right?

Don't forget to add the following on the top in your jsp:

<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!