aspose file tools
The moose likes Servlets and the fly likes Images, css and js files Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Images, css and js files" Watch "Images, css and js files" New topic
Author

Images, css and js files

Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 89

Hello everyone,
I am trying to put all the css, image files and javascript files as a part of my web-application so that I can use that path for calling those css, image or js files from the html. I want to do something similar to how you reference jquery, you put src="<jquery url>" and the html document would fetch the file from that url. So i want something like that in my web application so that i can create sources like www.mysite.com/cssfiles/slider.css and then put that url reference in my webpages so that they can access it.
Is there a way I can put these files in my web application file structure and can access them through url.
Please give me some ideas.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56163
    
  13

Sure. Just put them anywhere in the web app other than under WEB-INF.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 89

Thanks for the reply
So then what would be the url for accessing it through internet // What would be the base folder of it //
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56163
    
  13

The same base as your web app.
Dhaval J. Patel
Ranch Hand

Joined: Mar 10, 2011
Posts: 89

Hi Bear,
I figured it out .. Thanks for your help
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Images, css and js files
 
Similar Threads
denie to access projects file
Do desktop web browsers and Android cache resources differently?
Servlet can't find Image file.
Difficulty in image file accessing
How restrict the access for web content resources files?