The moose likes Tomcat and the fly likes javascript+tomcat.... Help... Urgent. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "javascript+tomcat.... Help... Urgent." Watch "javascript+tomcat.... Help... Urgent." New topic
Author

javascript+tomcat.... Help... Urgent.

Sam Pat
Greenhorn

Joined: Feb 20, 2003
Posts: 9
Hi,
I need to use JavaScript file in my application.
Can someone tell me where can i put my javascript file in tomcat.
Someone told me to put it in webapp.
SO i created a javascript folder in webapp.
I am calling like this.
<script language=JavaScript src='/webapps/JavaScript/GridSort.js'></script>
But somehow it can not find the js file.
Any help will be greatly appreciated.
Thanks.
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

What is 'webapp'? (or is it 'webapps'? you need to be consistent in your questions or no one will be able to help you)
Is it the root of your web application?
A little more context about how your mapping is set up is needed to answer your question.
In general, a JS file is no different from any other resource; be it a JSP page, an HTML page or image. You can place it anywhere within your web app folder structure that makes sense (although anything under WEB-INF is hidden). Then you would use the same URL path to get to the JS file that you would to access a JSP or other resource.
hth,
bear
[ June 19, 2003: Message edited by: Bear Bibeault ]

[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Sam Pat
Greenhorn

Joined: Feb 20, 2003
Posts: 9
Figured it out...
Thanks...
 
 
subject: javascript+tomcat.... Help... Urgent.
 
Threads others viewed
Problem with javascript include
Understanding .init()
problem calling external js file
javascript in JSP
Searching and extracting
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com