Liferay< portlet:actionURL> [英] Liferay <portlet:actionURL>

查看:85
本文介绍了Liferay< portlet:actionURL>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的jsp中,我有以下代码:

In my jsp I have the following code:

<portlet:actionURL name="addDetails" var="addDetailsURL" />
<aui:form name="addDetails" action="<%=addDetailsURL.toString() %>" method="post" >
        <aui:input type="text" label="name:" name="name" value="" />
        <aui:input type="text" label="surname:" name="surname" value="" />
        <aui:input type="text" label="age:" name="age" value="" />
        <aui:button type="submit" value="addDetails" />
</aui:form>

我正在使用liferay.我想提交将在java类中处理的数据. 我的java类几乎没有功能.提交表单后,我应该如何在上述jsp中指定它应访问java中的特定功能?

I am using liferay. I want to submit this data which will be processed in a java class. my java class has few functions. how should I specify in the above jsp that it should access the particular function in java after submitting the form?

推荐答案

如果您的portlet继承了MVCPortlet,只需创建一个与actionURL相同的名称"的公共方法,该方法需要一个ActionRequestActionResponse参数:

If your portlet inherits MVCPortlet, simply create a public method with the same "name" as your actionURL, that takes an ActionRequest and ActionResponse argument:

public void addDetails(ActionRequest req, ActionResponse rsp) {
    // ...
}

这篇关于Liferay&lt; portlet:actionURL&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆