简体   繁体   English

未调用actionURL中的方法

[英]method in actionURL not being called

I have defined a jsp in which the following code is there:- 我定义了一个jsp,其中包含以下代码:

<portlet:actionURL name="checkOtp" var="otpDemo"></portlet:actionURL>
<form method="post" action="<%= otpDemo %>">
Enter otp:
<input type="text" name="otpText"/>
<input type="submit" value="Submit" />
</form>

When I submit the form I am getting Error as : Render response is null because this tag is not being called within the context of a portlet How to get rid of this error.Please help..Thanx in advance. 提交表单时,我收到以下错误消息: Render response is null because this tag is not being called within the context of a portlet如何摆脱此错误。请提前提供帮助。

As, I assume that you are passing RenderRequest and RenderResponse objects to that action method, while these objects should be of ActionRequest and ActionResponse type. 同样,我假设您正在将RenderRequestRenderResponse对象传递给该操作方法,而这些对象应为ActionRequestActionResponse类型。

If yes, for given <portlet:actionURL name="checkOtp" var="otpDemo"></portlet:actionURL> , your actionListener method in portlet's action class will be: 如果是,对于给定的<portlet:actionURL name="checkOtp" var="otpDemo"></portlet:actionURL> ,您在portlet的操作类中的actionListener方法将为:

public void checkOtp(ActionRequest actionRequest, ActionResponse actionResponse)
    throws IOException, PortletException {
        // your logic goes here
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM