Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在某个目录(在tomcat中)注册任何文件以从java程序访问它(通过url)?
就像是:
pseudo-code registerResource("file.txt","http:\\localhost:8080\file.txt); [...] File txt= new File( getResource( "http:\\localhost:8080\file.txt" ) );
你能举一些例子吗?
您可以将其放在战争的根文件夹中。然后在你的 Tomcat 中部署这场战争。