【发布时间】:2018-10-30 22:58:33
【问题描述】:
@Path("/other")
public class Testclass {
@GET
@Path("/filepath")
@Produces("text/html")
public FileInputStream login() {
File file = new File("standalone/deployments/domaci8.war/login.html");
try {
return new FileInputStream(file.getAbsolutePath());
} catch (FileNotFoundException e) {
e.printStackTrace();
return null;
}
}
}
file.getAbsolutePath() 方法返回:
C:\Program Files (x86)\wildfly-10.1.0\bin\standalone\deployments\domaci8.war\login.html
而login.html文件位于这里:
C:\Program Files (x86)\wildfly-10.1.0\standalone\deployments\domaci8.war\login.html
【问题讨论】:
标签: java rest path jax-rs wildfly