Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

NetBeans 6.8 and JavaScript libraries

 
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys... Im playing with netbeans 6.8, and have found that I cannot add javascript libraries. In particular, I note that my problem has been seen before on another forum http://forums.netbeans.org/topic20226.html..... And has remained outstanding.

1) I cannot add the libraries via Libraries->add New library ... because, for some reason, netbeans does not give me an option to add javascript , only server/class libraries.

2) Under Tools -> Plugins -> Available Plugins, I do not see any javascript options, such as JQuery.

Thus none of the NetBeans suggested mechanisms for adding javascript libraries to a netbeans project work.

Im a little aftraid to manually add javascript libraries to my project, given the fact that netbeans is managing the builds for me, and in any case, i am not sure where the right directory to add them to is.....

Any advice will be appreciated.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're confusing Java and JavaScript libraries. JavaScript libraries are nothing like Java libraries. Just put the JavaScript libraries in your web content directory.
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh okay, well on the post it mentions "javascript" libraries, and I assumed there was a direct need for javascript scripts to be in a certain directory. So, the javascript files only have to be in the "web content" directory ? Not another place i.e. web-inf ?

Here is my directory structure in netbeans ....


My javascript is associated with a folder with several other resources in it, so its acutally a whole folder that I need
to add.
v.jpg
[Thumbnail for v.jpg]
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If they're in WEB-INF (please note correct capitalization; there's no need to post a screen shot of a directory structure when you can just get a directory) they won't be able to be served.
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The screen shot was for any Net Beans users that are making the switch from eclipse like me.

I put the folder containing my scripts in the "web" directory. then added the



Where dir structure is like so :

project
--web
---meta-inf
---web-inf
---myScripts
----script1.js



That fixed it.

Thanks
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

jay vas wrote: src="./myScripts/script1.js">


Bad idea. Page-relative URLs are death in a web app. Your URLs should be server-relative, starting with the context path. See the JSP FAQ for info on how to so this without hard-coding the context path (which is bad).
 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic