尝试在 tomcat 8 中的 RSSFeedParser 类中创建 Feed 对象时显示该错误
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [23] in the jsp file:hello.jsp The type Feed cannot be resolved. It is indirectly referenced from required .class files
22: <% RSSFeedParser parser = new RSSFeedParser("http://rss.cnn.com/rss/cnn_topstories.rss"); 23:
Feed feed = parser.readFeed();An error occurred at line: [23] in the jsp file: hello.jsp The method readFeed() from the type RSSFeedParser refers to the missing type Feed 20: <% String src = request.getParameter("src"); %> 21: <%= src %> 22: <% RSSFeedParser parser = new RSSFeedParser("http://rss.cnn.com/rss/cnn_topstories.rss"); 23:
Feed feed = parser.readFeed();
出了什么问题?
最佳答案
检查 WEB-INF/lib 文件夹。您可能会错过包含 Feed 类的 JAR 文件。
关于java - 无法解析类型。它间接引用所需的 .class 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50877687/