【发布时间】:2013-04-16 17:47:33
【问题描述】:
我在 java 文件中有字符串类型方法,它包含字符串数组,当我尝试在 jsp 中调用时,它给了我一个错误。
public String[] ordering(ActionRequest actionRequest,ActionResponse actionResponse)
throws IOException,PortletException
JSP:
<%
TestiPortlet obj=new TestiPortlet();
String str[]=obj.ordering(actionRequest,actionResponse);
out.println(str[0]);
%>
错误:
Multiple annotations found at this line:- actionResponse cannot be resolved to a variabl-actionRequest cannot be resolved to a variable
Stacktrace:
javax.portlet.PortletException: org.apache.jasper.JasperException: An exception occurred processing JSP page /html/testi/list.jsp at line 8
5:
6: <%
7: TestiPortlet obj=new TestiPortlet();
8: String str[]=obj.ordering(actionRequest,actionResponse);
9: out.println(str[0]);
10: %>
11:
【问题讨论】:
-
这是调用带有参数
ActionRequest和ActionResponse的方法的一种非常有趣的方式。我真的很想知道你在这里试图实现的这个美妙的用例是什么:-)。您能否粘贴整个堆栈跟踪,例如此错误出现在哪一行。谢谢 -
@RasabihariKumar 显示以上版本