This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
i have a jsp page which is been forwarded from servlet using requet dispatcher
but the js is not getting loaded.Jsp page gives error when i call any of the function defined in the util.js file
Pankaj, what everyone is trying to tell you here is that don't use a relative path to point to your script. Use an absolute path starting from the context path. You can use EL to get the context path. Its something like this
The relative syntax will work on the basis of the request URL. If your relative path is correct on the basis of the location of the JSP, that doesn't mean that it will work...
You can also use the HTML base tag to aid you. Specify the absolute path of the script file in question to avoid confusion. Use a browser based debugger like firebug to check for broken links to the JS