我已经定义了一个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>
当我提交表单时,我收到错误:Render response is null because this tag is not being called within the context of a portlet
如何摆脱这个错误。请提前帮助。谢谢。
答案 0 :(得分:1)
因为,我假设您将RenderRequest
和RenderResponse
个对象传递给该操作方法,而这些对象应该是ActionRequest
和ActionResponse
类型。
如果是,对于给定的<portlet:actionURL name="checkOtp" var="otpDemo"></portlet:actionURL>
,portlet动作类中的actionListener
方法将为:
public void checkOtp(ActionRequest actionRequest, ActionResponse actionResponse)
throws IOException, PortletException {
// your logic goes here
}