user1365697
user1365697

Reputation: 5999

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 ?

Upvotes: 0

Views: 1205

Answers (1)

Waleed Almadanat
Waleed Almadanat

Reputation: 1037

You can place those files within your web application's WAR file under a path on the class-path, this way they will be accessible as resources to your app using relative paths.

Upvotes: 1

Related Questions