File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Where to store css and js files in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Where to store css and js files in eclipse" Watch "Where to store css and js files in eclipse" New topic
Author

Where to store css and js files in eclipse

P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Hi

Iam developeing jsp page in eclipse, my project is i wants to show some datas in tree structure, for that i used jquery now its fine but without internet it is not working, by useing some sites it takeing 2 js files and 2css files. now i got the css and js code but i don't know where i want to store the files. and the main thing is i need to mention the path of the css anf js file in my treestructure code. This is my first project so i don't know many things because iam new to developing filed, please guide me. below i have mention my code

<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" href="http://jquery.bassistance.de/treeview/demo/screen.css" type="text/css" />
<link rel="stylesheet" href="http://jquery.bassistance.de/treeview/jquery.treeview.css" type="text/css" />
<script type="text/javascript" src="http://jquery.bassistance.de/treeview/jquery.treeview.js"></script>
<script>
$(document).ready(function()
{
$("#example").treeview();
});

</script>
</head>


This is my code for tree structure, please anyone help me to solve my problem.


Thanks in advance.


Thank & Regards,
Jenifer Rajkumar.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1479
    
    6

It can reside in the same folder where your html/jsp page resides, or it can reside in any sub folder within that too. But accordingly to you have to specify the path.


Swastik
Karthik Shiraly
Ranch Hand

Joined: Apr 04, 2009
Posts: 537
    
    7
Deploy them in subdirectories under "[your-project]/WebContent". I usually name the subdirectories "js" and "css".
Then use relative paths like this:

If your web application URL is something like "http://localhost:8080/mywebapp", then a relative path like "css/screen.css" will be treated by browser as "http://localhost:8080/mywebapp/css/screen.css".

On a side note - for future reference - never link to other sites directly like you've done to http://jquery.bassistance.de, unless you have their permission or unless they state that the URL is available for public use.
It's called "hotlinking" - or more pejoratively, "leaching".
It's bad web etiquette, because you're making the owner of that private site serve your users. It'll increase their bandwidth costs, and the load on their servers.

Neeraj Dhiman
Ranch Hand

Joined: Dec 19, 2011
Posts: 66

yes you can store any folder and sub folder where your html/jsp page reside.
if you store in the same folder you can just access it by giving the name.
e.g

if you have a sub folder named jsfolder


and if it is in one step back hierarchy
then



Correct Me if i am wrong
P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
I have created sub folder and pasted the code but still it is not running.
P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Hi

Thank You so much, now it is running successfully, thank for Your guide.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where to store css and js files in eclipse