Hi All,

I have one strange issue, JSP cannot Identify the JS, CSS file path when URL pattern is /*. Let me explain in detail.

Irrespective of relative path my application should have to call Home.jsp. So for that I have specified URL pattern as /*. This logic is working fine.
The application is calling JSP page but It cannot call the JS file. In the below Sample code I try to print two alert massages. But I am able to see only one alert message "welcome". Not able to see the alert message in Hi.js file. I tried with all possible scenarios by changing path but its not working. CAN ANY BODY PLEASE HELP ME IN THIS.

One more thing I have to mention here when I change the URL pattern to some /xyz its working fine. Please Help me in this issue.

My Directory Structure.




<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script language="javascript" type="text/javascript" src="Hi.js"></script>
<meta http-equiv="Content-Type" content="text/javascript; charset=ISO-8859-1">
window.onload = function(){
function welcome() {



function HI() {
	alert("Calling Out side JS File");

you can try

<script language="javascript" 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.