【发布时间】:2017-03-27 12:52:50
【问题描述】:
您好,我正在使用 program ab 中的 java 创建聊天机器人 Web 应用程序。如果我从外部存储访问文件,它正在工作。如果我将文件存储在我的项目中,它不起作用?我不知道是什么问题。
此代码不起作用,ServerCode 是我在 Eclipse 中的项目名称。
String botName = "super";
String botPath = "ServerCode/aiml";
Bot bot = new Bot(botName, botPath);
Chat chatSession = new Chat(bot);
String request = msg.toUpperCase();
String response = chatSession.multisentenceRespond(request);
System.out.println(response);
当这段代码运行时,
String botName = "super";
String botPath = "E:\ab";
Bot bot = new Bot(botName, botPath);
Chat chatSession = new Chat(bot);
String request = msg.toUpperCase();
String response = chatSession.multisentenceRespond(request);
System.out.println(response);
有什么问题?如何在项目中存储文件夹及其子文件夹,以便在创建war 文件时,将这些文件包含在该war 文件中。
【问题讨论】: