File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes JavaScript not loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JavaScript not loading" Watch "JavaScript not loading" New topic

JavaScript not loading

rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
Bear Bibeault wrote:Most likely your URLs are not properly formed. You should be using server-relative addresses that start with the context path. see the JspFaq for details.

I am having the same problem. i am using calendar in servlet but java script is not called..calendar is not displayed...code is here. but this code is not working.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

First, why are you emitting all this crud from a Servlet rather than using a JSP.

Secondly, you are using a protocol.

"C:/../calendar.css" will not work ever. First of all, you can't use file protocols on the web and expect things to work on any system other than your own. Do you really think that everyone using your app is going to have your files on their systems? Moreover, that's not even a valid file URL.

See the JspFaq (the entry named ResourceUrlProblems) and modify your resource URLs to use server-relative URLs that begin with the context path.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JavaScript not loading
It's not a secret anymore!