0
我想打印從函數返回的字符串值。JspWriter類型中的print(boolean)方法不適用於參數
但我得到的錯誤,即使是這個簡單的過程。
錯誤:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 16 in the jsp file: /beansal.jsp
The method print(boolean) in the type JspWriter is not applicable for the arguments (void)
13: </head>
14: <body>
15: <%String s = new DBConnectionTest().Test();%>
16: <%=System.out.println(s)%>
17: <jsp:getProperty name="person" property="name"></jsp:getProperty>
18: <jsp:getProperty name="person" property="lastName"></jsp:getProperty>
19: </body>
我做it.Error org.apache.jasper.JasperException:發生異常在線處理JSP頁/beansal.jsp 16 13: 14:
15: 16:<(%)=新DBConnectionTest( ).Test()%> 17:DBConnectionTest是否在任何包? – CrawlingKid
Add ..'<%@ page import =「mypackage.DBConnectionTest」%>'。不屬於任何包的類,jsp有時無法找到它。 – CrawlingKid