简体   繁体   中英

How to read file from jetty server

My project is based on jetty server. ( java server and java script in the client )

I want to read javascript files and load them to the project.

I want to do it in dynamic way.

The problem that I don't want to read the files from c:.... but to use the jetty server to read those files.

I know the class of the project that I want to read the files but I dont know how to read the files.

If i will give the location of the folder C:..... then I will get the files but it is not the right way.

is it possible to read files in the project from the jetty server based on the name of the class of the project ?

How i can do it ?

您可以将这些文件放在Web应用程序的WAR文件中的类路径下的某个路径下,这样可以使用相对路径将它们作为应用程序的资源进行访问。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM